|
14 | 14 | use InvalidArgumentException; |
15 | 15 | use Iterator; |
16 | 16 | use ObjectShapesAcceptance\ClassWithFooIntProperty; |
| 17 | +use PHPStan\Fixture\AnotherTestEnum; |
17 | 18 | use PHPStan\Fixture\FinalClass; |
| 19 | +use PHPStan\Fixture\TestEnum; |
| 20 | +use PHPStan\Fixture\TestEnumInterface; |
18 | 21 | use PHPStan\Testing\PHPStanTestCase; |
19 | 22 | use PHPStan\Type\Accessory\AccessoryLiteralStringType; |
20 | 23 | use PHPStan\Type\Accessory\AccessoryNonEmptyStringType; |
@@ -2494,6 +2497,34 @@ public function dataUnion(): iterable |
2494 | 2497 | UnionType::class, |
2495 | 2498 | 'array{a?: true, b: true}|(array{a?: true, c?: true}&non-empty-array)', |
2496 | 2499 | ]; |
| 2500 | + |
| 2501 | + yield [ |
| 2502 | + [ |
| 2503 | + new EnumCaseObjectType(AnotherTestEnum::class, 'ONE'), |
| 2504 | + new EnumCaseObjectType(AnotherTestEnum::class, 'TWO'), |
| 2505 | + new ObjectType(TestEnumInterface::class), |
| 2506 | + ], |
| 2507 | + UnionType::class, |
| 2508 | + 'PHPStan\Fixture\AnotherTestEnum::ONE|PHPStan\Fixture\AnotherTestEnum::TWO|PHPStan\Fixture\TestEnumInterface', |
| 2509 | + ]; |
| 2510 | + yield [ |
| 2511 | + [ |
| 2512 | + new EnumCaseObjectType(TestEnum::class, 'ONE'), |
| 2513 | + new EnumCaseObjectType(TestEnum::class, 'TWO'), |
| 2514 | + new ObjectType(TestEnumInterface::class), |
| 2515 | + ], |
| 2516 | + ObjectType::class, |
| 2517 | + TestEnumInterface::class, |
| 2518 | + ]; |
| 2519 | + yield [ |
| 2520 | + [ |
| 2521 | + new EnumCaseObjectType(TestEnum::class, 'ONE'), |
| 2522 | + new EnumCaseObjectType(TestEnum::class, 'TWO'), |
| 2523 | + new ObjectWithoutClassType(), |
| 2524 | + ], |
| 2525 | + ObjectWithoutClassType::class, |
| 2526 | + 'object', |
| 2527 | + ]; |
2497 | 2528 | } |
2498 | 2529 |
|
2499 | 2530 | /** |
|
0 commit comments