|
19 | 19 | use PHPStan\Reflection\Callables\SimpleImpurePoint; |
20 | 20 | use PHPStan\Testing\PHPStanTestCase; |
21 | 21 | use PHPStan\TrinaryLogic; |
| 22 | +use PHPStan\Type\Accessory\AccessoryArrayListType; |
22 | 23 | use PHPStan\Type\Accessory\AccessoryLiteralStringType; |
23 | 24 | use PHPStan\Type\Accessory\AccessoryLowercaseStringType; |
24 | 25 | use PHPStan\Type\Accessory\AccessoryNonEmptyStringType; |
@@ -4216,6 +4217,44 @@ public static function dataIntersect(): iterable |
4216 | 4217 | StringType::class, |
4217 | 4218 | 'string', |
4218 | 4219 | ], |
| 4220 | + [ |
| 4221 | + [ |
| 4222 | + new ConstantArrayType( |
| 4223 | + [new ConstantStringType('a')], |
| 4224 | + [new ConstantStringType('foo')], |
| 4225 | + ), |
| 4226 | + new AccessoryArrayListType(), |
| 4227 | + ], |
| 4228 | + NeverType::class, |
| 4229 | + '*NEVER*=implicit', |
| 4230 | + ], |
| 4231 | + [ |
| 4232 | + [ |
| 4233 | + new ConstantArrayType( |
| 4234 | + [new ConstantIntegerType(0), new ConstantIntegerType(1)], |
| 4235 | + [new ConstantStringType('foo'), new ConstantStringType('bar')], |
| 4236 | + [2], |
| 4237 | + isList: TrinaryLogic::createMaybe(), |
| 4238 | + ), |
| 4239 | + new AccessoryArrayListType(), |
| 4240 | + ], |
| 4241 | + ConstantArrayType::class, |
| 4242 | + 'array{\'foo\', \'bar\'}', |
| 4243 | + ], |
| 4244 | + [ |
| 4245 | + [ |
| 4246 | + new ConstantArrayType( |
| 4247 | + [new ConstantIntegerType(0), new ConstantIntegerType(1)], |
| 4248 | + [new ConstantStringType('foo'), new ConstantStringType('bar')], |
| 4249 | + [2], |
| 4250 | + [0, 1], |
| 4251 | + TrinaryLogic::createMaybe(), |
| 4252 | + ), |
| 4253 | + new AccessoryArrayListType(), |
| 4254 | + ], |
| 4255 | + ConstantArrayType::class, |
| 4256 | + 'list{0?: \'foo\', 1?: \'bar\'}', |
| 4257 | + ], |
4219 | 4258 | ]; |
4220 | 4259 |
|
4221 | 4260 | if (PHP_VERSION_ID < 80100) { |
|
0 commit comments