Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions tests/PHPStan/Type/IntersectionTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use DoctrineIntersectionTypeIsSupertypeOf\Collection;
use Iterator;
use ObjectTypeEnums\FooEnum;
use PHPStan\DependencyInjection\BleedingEdgeToggle;
use PHPStan\Testing\PHPStanTestCase;
use PHPStan\TrinaryLogic;
use PHPStan\Type\Accessory\AccessoryArrayListType;
Expand Down Expand Up @@ -132,20 +133,20 @@ public static function dataIsAcceptedBy(): Iterator
// array&callable isAcceptedBy constantArray{stdClass, string} - maybe
yield [
new IntersectionType([new ArrayType(new MixedType(), new MixedType()), new CallableType()]),
new ConstantArrayType(
BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType(
[new ConstantIntegerType(0), new ConstantIntegerType(1)],
[new UnionType([new ObjectType('stdClass'), new StringType()]), new StringType()],
),
)),
TrinaryLogic::createMaybe(),
];

// array&callable isAcceptedBy constantArray{string, string} - maybe
yield [
new IntersectionType([new ArrayType(new MixedType(), new MixedType()), new CallableType()]),
new ConstantArrayType(
BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType(
[new ConstantIntegerType(0), new ConstantIntegerType(1)],
[new StringType(), new StringType()],
),
)),
TrinaryLogic::createMaybe(),
];

Expand Down Expand Up @@ -189,10 +190,10 @@ public static function dataIsAcceptedBy(): Iterator
new NonEmptyArrayType(),
new HasOffsetValueType(new ConstantIntegerType(0), new IntegerType()),
]),
new ConstantArrayType(
BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType(
[new ConstantIntegerType(0), new ConstantIntegerType(1)],
[new IntegerType(), new IntegerType()],
),
)),
TrinaryLogic::createMaybe(),
];

Expand All @@ -203,10 +204,10 @@ public static function dataIsAcceptedBy(): Iterator
new NonEmptyArrayType(),
new HasOffsetValueType(new ConstantIntegerType(0), new IntegerType()),
]),
new ConstantArrayType(
BleedingEdgeToggle::withBleedingEdge(false, static fn (): ConstantArrayType => new ConstantArrayType(
[new ConstantIntegerType(0), new ConstantIntegerType(1)],
[new StringType(), new StringType()],
),
)),
TrinaryLogic::createNo(),
];

Expand Down
Loading