|
10 | 10 | use PHPStan\Type\Accessory\AccessoryArrayListType; |
11 | 11 | use PHPStan\Type\Accessory\AccessoryLowercaseStringType; |
12 | 12 | use PHPStan\Type\Accessory\AccessoryUppercaseStringType; |
| 13 | +use PHPStan\Type\Accessory\HasOffsetType; |
| 14 | +use PHPStan\Type\Accessory\HasOffsetValueType; |
13 | 15 | use PHPStan\Type\Accessory\HasPropertyType; |
14 | 16 | use PHPStan\Type\Accessory\NonEmptyArrayType; |
15 | 17 | use PHPStan\Type\Accessory\OversizedArrayType; |
@@ -70,6 +72,30 @@ public static function dataAccepts(): Iterator |
70 | 72 | new CallableType(), |
71 | 73 | TrinaryLogic::createMaybe(), |
72 | 74 | ]; |
| 75 | + |
| 76 | + yield [ |
| 77 | + TypeCombinator::intersect( |
| 78 | + new ArrayType(new MixedType(), new MixedType()), |
| 79 | + new NonEmptyArrayType(), |
| 80 | + ), |
| 81 | + TypeCombinator::intersect( |
| 82 | + new ArrayType(new MixedType(), new MixedType()), |
| 83 | + new HasOffsetType(new ConstantStringType("some-key")), |
| 84 | + ), |
| 85 | + TrinaryLogic::createYes(), |
| 86 | + ]; |
| 87 | + |
| 88 | + yield [ |
| 89 | + TypeCombinator::intersect( |
| 90 | + new ArrayType(new MixedType(), new MixedType()), |
| 91 | + new NonEmptyArrayType(), |
| 92 | + ), |
| 93 | + TypeCombinator::intersect( |
| 94 | + new ArrayType(new MixedType(), new MixedType()), |
| 95 | + new HasOffsetValueType(new ConstantStringType("some-key"), new IntegerType()), |
| 96 | + ), |
| 97 | + TrinaryLogic::createYes(), |
| 98 | + ]; |
73 | 99 | } |
74 | 100 |
|
75 | 101 | #[DataProvider('dataAccepts')] |
|
0 commit comments