File tree Expand file tree Collapse file tree 3 files changed +13
-12
lines changed
src/Type/Doctrine/Descriptors Expand file tree Collapse file tree 3 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,15 @@ public function getWritableToPropertyType(): Type
2525 return new IntegerType ();
2626 }
2727
28- return TypeCombinator:: intersect (new StringType (), new AccessoryNumericStringType () );
28+ return (new IntegerType ())-> toString ( );
2929 }
3030
3131 public function getWritableToDatabaseType (): Type
3232 {
33- return TypeCombinator::union (new StringType (), new IntegerType ());
33+ return TypeCombinator::union (
34+ new IntegerType (),
35+ (new IntegerType ())->toString ()
36+ );
3437 }
3538
3639 public function getDatabaseInternalType (): Type
Original file line number Diff line number Diff line change @@ -31,12 +31,16 @@ public function getType(): string
3131
3232 public function getWritableToPropertyType (): Type
3333 {
34- return TypeCombinator:: intersect (new StringType (), new AccessoryNumericStringType () );
34+ return (new FloatType ())-> toString ( );
3535 }
3636
3737 public function getWritableToDatabaseType (): Type
3838 {
39- return TypeCombinator::union (new StringType (), new FloatType (), new IntegerType ());
39+ return TypeCombinator::union (
40+ new FloatType (),
41+ new IntegerType (),
42+ (new FloatType ())->toString ()
43+ );
4044 }
4145
4246 public function getDatabaseInternalType (): Type
@@ -58,10 +62,7 @@ public function getDatabaseInternalTypeForDriver(Connection $connection): Type
5862 DriverDetector::PGSQL ,
5963 DriverDetector::PDO_PGSQL ,
6064 ], true )) {
61- return new IntersectionType ([
62- new StringType (),
63- new AccessoryNumericStringType (),
64- ]);
65+ return (new FloatType ())->toString ();
6566 }
6667
6768 // not yet supported driver, return the old implementation guess
Original file line number Diff line number Diff line change @@ -42,10 +42,7 @@ public function getDatabaseInternalType(): Type
4242 {
4343 return TypeCombinator::union (
4444 new \PHPStan \Type \FloatType (),
45- new IntersectionType ([
46- new StringType (),
47- new AccessoryNumericStringType (),
48- ])
45+ (new \PHPStan \Type \FloatType ())->toString ()
4946 );
5047 }
5148
You can’t perform that action at this time.
0 commit comments