Skip to content

Commit 6752622

Browse files
committed
Update IntersectionTypeTest.php
1 parent a82b09e commit 6752622

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

tests/PHPStan/Type/IntersectionTypeTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use PHPStan\Type\Accessory\AccessoryArrayListType;
1111
use PHPStan\Type\Accessory\AccessoryLowercaseStringType;
1212
use PHPStan\Type\Accessory\AccessoryUppercaseStringType;
13+
use PHPStan\Type\Accessory\HasOffsetType;
14+
use PHPStan\Type\Accessory\HasOffsetValueType;
1315
use PHPStan\Type\Accessory\HasPropertyType;
1416
use PHPStan\Type\Accessory\NonEmptyArrayType;
1517
use PHPStan\Type\Accessory\OversizedArrayType;
@@ -70,6 +72,30 @@ public static function dataAccepts(): Iterator
7072
new CallableType(),
7173
TrinaryLogic::createMaybe(),
7274
];
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+
];
7399
}
74100

75101
#[DataProvider('dataAccepts')]

0 commit comments

Comments
 (0)