|
18 | 18 | use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor;
|
19 | 19 | use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
|
20 | 20 | use Symfony\Component\PropertyInfo\PropertyInfoExtractor;
|
21 |
| -use Symfony\Component\Serializer\Annotation\Ignore; |
| 21 | +use Symfony\Component\Serializer\Attribute\Ignore; |
22 | 22 | use Symfony\Component\Serializer\Exception\LogicException;
|
23 | 23 | use Symfony\Component\Serializer\Exception\RuntimeException;
|
24 | 24 | use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
@@ -902,26 +902,26 @@ public function testSamePropertyAsMethodWithMethodSerializedName()
|
902 | 902 | $this->assertSame($expected, $this->normalizer->normalize($object));
|
903 | 903 | }
|
904 | 904 |
|
905 |
| - public function testNormalizeWithIgnoreAnnotationAndPrivateProperties() |
| 905 | + public function testNormalizeWithIgnoreAttributeAndPrivateProperties() |
906 | 906 | {
|
907 |
| - $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); |
| 907 | + $classMetadataFactory = new ClassMetadataFactory(new AttributeLoader()); |
908 | 908 | $normalizer = new ObjectNormalizer($classMetadataFactory);
|
909 | 909 |
|
910 |
| - $this->assertSame(['foo' => 'foo'], $normalizer->normalize(new ObjectDummyWithIgnoreAnnotationAndPrivateProperty())); |
| 910 | + $this->assertSame(['foo' => 'foo'], $normalizer->normalize(new ObjectDummyWithIgnoreAttributeAndPrivateProperty())); |
911 | 911 | }
|
912 | 912 |
|
913 |
| - public function testDenormalizeWithIgnoreAnnotationAndPrivateProperties() |
| 913 | + public function testDenormalizeWithIgnoreAttributeAndPrivateProperties() |
914 | 914 | {
|
915 |
| - $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); |
| 915 | + $classMetadataFactory = new ClassMetadataFactory(new AttributeLoader()); |
916 | 916 | $normalizer = new ObjectNormalizer($classMetadataFactory);
|
917 | 917 |
|
918 | 918 | $obj = $normalizer->denormalize([
|
919 | 919 | 'foo' => 'set',
|
920 | 920 | 'ignore' => 'set',
|
921 | 921 | 'private' => 'set',
|
922 |
| - ], ObjectDummyWithIgnoreAnnotationAndPrivateProperty::class); |
| 922 | + ], ObjectDummyWithIgnoreAttributeAndPrivateProperty::class); |
923 | 923 |
|
924 |
| - $expected = new ObjectDummyWithIgnoreAnnotationAndPrivateProperty(); |
| 924 | + $expected = new ObjectDummyWithIgnoreAttributeAndPrivateProperty(); |
925 | 925 | $expected->foo = 'set';
|
926 | 926 |
|
927 | 927 | $this->assertEquals($expected, $obj);
|
@@ -1199,11 +1199,11 @@ public function getInner()
|
1199 | 1199 | }
|
1200 | 1200 | }
|
1201 | 1201 |
|
1202 |
| -class ObjectDummyWithIgnoreAnnotationAndPrivateProperty |
| 1202 | +class ObjectDummyWithIgnoreAttributeAndPrivateProperty |
1203 | 1203 | {
|
1204 | 1204 | public $foo = 'foo';
|
1205 | 1205 |
|
1206 |
| - /** @Ignore */ |
| 1206 | + #[Ignore] |
1207 | 1207 | public $ignored = 'ignored';
|
1208 | 1208 |
|
1209 | 1209 | private $private = 'private';
|
|
0 commit comments