|
20 | 20 | use PHPStan\Type\Doctrine\Descriptors\JsonType;
|
21 | 21 | use PHPStan\Type\Doctrine\Descriptors\Ramsey\UuidTypeDescriptor;
|
22 | 22 | use PHPStan\Type\Doctrine\Descriptors\ReflectionDescriptor;
|
| 23 | +use PHPStan\Type\Doctrine\Descriptors\SimpleArrayType; |
23 | 24 | use PHPStan\Type\Doctrine\Descriptors\StringType;
|
24 | 25 | use PHPStan\Type\Doctrine\ObjectMetadataResolver;
|
25 | 26 | use Ramsey\Uuid\Doctrine\UuidType;
|
@@ -68,6 +69,7 @@ protected function getRule(): Rule
|
68 | 69 | new JsonType(),
|
69 | 70 | new IntegerType(),
|
70 | 71 | new StringType(),
|
| 72 | + new SimpleArrayType(), |
71 | 73 | new UuidTypeDescriptor(UuidType::class),
|
72 | 74 | new ReflectionDescriptor(CarbonImmutableType::class, $this->createBroker()),
|
73 | 75 | new ReflectionDescriptor(CarbonType::class, $this->createBroker()),
|
@@ -156,6 +158,14 @@ public function testRule(?string $objectManagerLoader): void
|
156 | 158 | 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenEntity::$incompatibleJsonValueObject type mapping mismatch: property can contain PHPStan\Rules\Doctrine\ORM\EmptyObject but database expects array|bool|float|int|JsonSerializable|stdClass|string|null.',
|
157 | 159 | 156,
|
158 | 160 | ],
|
| 161 | + [ |
| 162 | + 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenEntity::$invalidSimpleArray type mapping mismatch: database can contain array<int, string> but property expects array<int>.', |
| 163 | + 162, |
| 164 | + ], |
| 165 | + [ |
| 166 | + 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenEntity::$invalidSimpleArray type mapping mismatch: property can contain array<int> but database expects array<string>.', |
| 167 | + 162, |
| 168 | + ], |
159 | 169 | ]);
|
160 | 170 | }
|
161 | 171 |
|
@@ -211,6 +221,14 @@ public function testRuleWithAllowedNullableProperty(?string $objectManagerLoader
|
211 | 221 | 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenEntity::$incompatibleJsonValueObject type mapping mismatch: property can contain PHPStan\Rules\Doctrine\ORM\EmptyObject but database expects array|bool|float|int|JsonSerializable|stdClass|string|null.',
|
212 | 222 | 156,
|
213 | 223 | ],
|
| 224 | + [ |
| 225 | + 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenEntity::$invalidSimpleArray type mapping mismatch: database can contain array<int, string> but property expects array<int>.', |
| 226 | + 162, |
| 227 | + ], |
| 228 | + [ |
| 229 | + 'Property PHPStan\Rules\Doctrine\ORM\MyBrokenEntity::$invalidSimpleArray type mapping mismatch: property can contain array<int> but database expects array<string>.', |
| 230 | + 162, |
| 231 | + ], |
214 | 232 | ]);
|
215 | 233 | }
|
216 | 234 |
|
|
0 commit comments