|
33 | 33 | use Symfony\Component\PropertyInfo\Tests\Fixtures\SnakeCaseDummy;
|
34 | 34 | use Symfony\Component\PropertyInfo\Type as LegacyType;
|
35 | 35 | use Symfony\Component\TypeInfo\Type;
|
| 36 | +use Symfony\Component\TypeInfo\TypeResolver\PhpDocAwareReflectionTypeResolver; |
36 | 37 |
|
37 | 38 | /**
|
38 | 39 | * @author Kévin Dunglas <dunglas@gmail.com>
|
@@ -696,9 +697,9 @@ public function testExtractors(string $property, ?Type $type)
|
696 | 697 | */
|
697 | 698 | public static function typesProvider(): iterable
|
698 | 699 | {
|
699 |
| - yield ['a', null]; |
| 700 | + yield ['a', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::int() : null]; |
700 | 701 | yield ['b', Type::nullable(Type::object(ParentDummy::class))];
|
701 |
| - yield ['e', null]; |
| 702 | + yield ['e', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::list(Type::resource()) : null]; |
702 | 703 | yield ['f', Type::list(Type::object(\DateTimeImmutable::class))];
|
703 | 704 | yield ['donotexist', null];
|
704 | 705 | yield ['staticGetter', null];
|
@@ -881,8 +882,8 @@ public function testExtractConstructorType(string $property, ?Type $type)
|
881 | 882 | public static function extractConstructorTypesProvider(): iterable
|
882 | 883 | {
|
883 | 884 | yield ['timezone', Type::object(\DateTimeZone::class)];
|
884 |
| - yield ['date', null]; |
885 |
| - yield ['dateObject', null]; |
| 885 | + yield ['date', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::int() : null]; |
| 886 | + yield ['dateObject', class_exists(PhpDocAwareReflectionTypeResolver::class) ? Type::object(\DateTimeInterface::class) : null]; |
886 | 887 | yield ['dateTime', Type::object(\DateTimeImmutable::class)];
|
887 | 888 | yield ['ddd', null];
|
888 | 889 | }
|
|
0 commit comments