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
25
25
return new IntegerType ();
26
26
}
27
27
28
- return TypeCombinator:: intersect (new StringType (), new AccessoryNumericStringType () );
28
+ return (new IntegerType ())-> toString ( );
29
29
}
30
30
31
31
public function getWritableToDatabaseType (): Type
32
32
{
33
- return TypeCombinator::union (new StringType (), new IntegerType ());
33
+ return TypeCombinator::union (
34
+ new IntegerType (),
35
+ (new IntegerType ())->toString ()
36
+ );
34
37
}
35
38
36
39
public function getDatabaseInternalType (): Type
Original file line number Diff line number Diff line change @@ -31,12 +31,16 @@ public function getType(): string
31
31
32
32
public function getWritableToPropertyType (): Type
33
33
{
34
- return TypeCombinator:: intersect (new StringType (), new AccessoryNumericStringType () );
34
+ return (new FloatType ())-> toString ( );
35
35
}
36
36
37
37
public function getWritableToDatabaseType (): Type
38
38
{
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
+ );
40
44
}
41
45
42
46
public function getDatabaseInternalType (): Type
@@ -58,10 +62,7 @@ public function getDatabaseInternalTypeForDriver(Connection $connection): Type
58
62
DriverDetector::PGSQL ,
59
63
DriverDetector::PDO_PGSQL ,
60
64
], true )) {
61
- return new IntersectionType ([
62
- new StringType (),
63
- new AccessoryNumericStringType (),
64
- ]);
65
+ return (new FloatType ())->toString ();
65
66
}
66
67
67
68
// 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
42
42
{
43
43
return TypeCombinator::union (
44
44
new \PHPStan \Type \FloatType (),
45
- new IntersectionType ([
46
- new StringType (),
47
- new AccessoryNumericStringType (),
48
- ])
45
+ (new \PHPStan \Type \FloatType ())->toString ()
49
46
);
50
47
}
51
48
You can’t perform that action at this time.
0 commit comments