From c0c5fd4f84dd19d76e5418850169e98de32a3293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Mon, 4 Nov 2024 09:23:20 +0100 Subject: [PATCH] Use jms serializer php attributes --- .github/workflows/build.yml | 2 +- composer.json | 1 + tests/Application/src/Entity/Author.php | 18 +++----- tests/Application/src/Entity/Book.php | 28 ++++--------- tests/Application/src/Entity/ComicBook.php | 42 ++++++------------- .../src/Entity/CrudRoutes/BookWithAlias.php | 1 + .../Entity/CrudRoutes/BookWithCriteria.php | 4 +- .../src/Entity/CrudRoutes/BookWithExcept.php | 4 +- .../src/Entity/CrudRoutes/BookWithGrid.php | 4 +- .../CrudRoutes/BookWithLegacyAttribute.php | 4 +- .../src/Entity/CrudRoutes/BookWithOnly.php | 4 +- .../Entity/CrudRoutes/BookWithPermission.php | 4 +- .../Entity/CrudRoutes/BookWithRedirect.php | 4 +- .../src/Entity/CrudRoutes/BookWithSection.php | 4 +- .../Entity/CrudRoutes/BookWithTemplate.php | 4 +- .../src/Entity/CrudRoutes/BookWithVars.php | 4 +- .../src/Entity/Route/PublishBook.php | 4 +- .../Application/src/Entity/Route/ShowBook.php | 4 +- .../src/Entity/Route/ShowBookWithCriteria.php | 4 +- .../src/Entity/Route/ShowBookWithHost.php | 4 +- .../Route/ShowBookWithLegacyAttribute.php | 4 +- .../src/Entity/Route/ShowBookWithMethods.php | 4 +- .../src/Entity/Route/ShowBookWithOptions.php | 4 +- .../src/Entity/Route/ShowBookWithPriority.php | 4 +- .../Entity/Route/ShowBookWithRepository.php | 4 +- .../Entity/Route/ShowBookWithRequirements.php | 4 +- .../src/Entity/Route/ShowBookWithSchemes.php | 4 +- .../Route/ShowBookWithSerializationGroups.php | 4 +- .../ShowBookWithSerializationVersion.php | 4 +- .../src/Entity/Route/ShowBookWithTemplate.php | 4 +- .../src/Entity/Route/ShowBookWithVars.php | 4 +- 31 files changed, 53 insertions(+), 139 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf35fb3b2..433b205ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -163,7 +163,7 @@ jobs: composer remove --dev friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle --no-scripts (cd tests/Application && bin/console cache:clear --env=test_without_fosrest) (cd tests/Application && bin/console lint:container --env=test_without_fosrest) - composer require --dev friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle --no-scripts + composer require --dev friendsofsymfony/rest-bundle willdurand/hateoas-bundle "^2.0 || ^2.7@beta" jms/serializer-bundle --no-scripts - name: Run lint container without winzou/state-machine-bundle package diff --git a/composer.json b/composer.json index 641f676fc..45e2f744b 100644 --- a/composer.json +++ b/composer.json @@ -85,6 +85,7 @@ "symfony/security-bundle": "^5.4 || ^6.4 || ^7.0", "twig/twig": "^3.0", "vimeo/psalm": "^5.20", + "willdurand/hateoas": "^3.1 || ^3.12@beta", "willdurand/hateoas-bundle": "^2.0 || ^2.7@beta", "winzou/state-machine-bundle": "^0.6.2" }, diff --git a/tests/Application/src/Entity/Author.php b/tests/Application/src/Entity/Author.php index 9c0a2cec1..d93016739 100644 --- a/tests/Application/src/Entity/Author.php +++ b/tests/Application/src/Entity/Author.php @@ -16,25 +16,17 @@ use Doctrine\ORM\Mapping as ORM; use JMS\Serializer\Annotation as Serializer; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[ORM\Embeddable] final class Author { - /** - * @Serializer\Expose - * - * @Serializer\Type("string") - */ + #[Serializer\Expose] + #[Serializer\Type(name: 'string')] #[ORM\Column(name: 'first_name', length: 255)] private ?string $firstName = null; - /** - * @Serializer\Expose - * - * @Serializer\Type("string") - */ + #[Serializer\Expose] + #[Serializer\Type(name: 'string')] #[ORM\Column(name: 'last_name', length: 255)] private ?string $lastName = null; diff --git a/tests/Application/src/Entity/Book.php b/tests/Application/src/Entity/Book.php index e66623296..3695d725e 100644 --- a/tests/Application/src/Entity/Book.php +++ b/tests/Application/src/Entity/Book.php @@ -19,9 +19,7 @@ use Sylius\Resource\Model\TranslatableInterface; use Sylius\Resource\Model\TranslatableTrait; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[ORM\Entity] #[ORM\MappedSuperclass] #[ORM\Table(name: 'app_book')] @@ -31,23 +29,16 @@ class Book implements ResourceInterface, TranslatableInterface __construct as private initializeTranslationsCollection; } - /** - * @Serializer\Expose - * - * @Serializer\Type("integer") - * - * @Serializer\XmlAttribute - */ + #[Serializer\Expose] + #[Serializer\Type(name: 'integer')] + #[Serializer\XmlAttribute] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; - /** - * @Serializer\Expose - * - * @Serializer\Type("string") - */ + #[Serializer\Expose] + #[Serializer\Type(name: 'string')] #[ORM\Column(length: 255)] private ?string $author = null; @@ -56,11 +47,8 @@ public function getId(): ?int return $this->id; } - /** - * @Serializer\VirtualProperty() - * - * @Serializer\SerializedName("title") - */ + #[Serializer\VirtualProperty] + #[Serializer\SerializedName(name: 'title')] public function getTitle(): ?string { return $this->getTranslation()->getTitle(); diff --git a/tests/Application/src/Entity/ComicBook.php b/tests/Application/src/Entity/ComicBook.php index 75fa6c189..269ccd6eb 100644 --- a/tests/Application/src/Entity/ComicBook.php +++ b/tests/Application/src/Entity/ComicBook.php @@ -18,39 +18,27 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Model\ResourceInterface; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[ORM\Entity(repositoryClass: ComicBookRepository::class)] #[ORM\MappedSuperclass] #[ORM\Table(name: 'app_comic_book')] class ComicBook implements ResourceInterface { - /** - * @Serializer\Expose - * - * @Serializer\Type("integer") - * - * @Serializer\XmlAttribute - */ + #[Serializer\Expose] + #[Serializer\Type(name: 'integer')] + #[Serializer\XmlAttribute] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; - /** - * @Serializer\Expose - * - * @Serializer\Until("1.1") - */ + #[Serializer\Expose] + #[Serializer\Until(version: '1.1')] #[ORM\Embedded] private ?Author $author = null; - /** - * @Serializer\Expose - * - * @Serializer\Type("string") - */ + #[Serializer\Expose] + #[Serializer\Type(name: 'string')] #[ORM\Column(length: 255)] private ?string $title = null; @@ -69,21 +57,15 @@ public function setTitle(?string $title): void $this->title = $title; } - /** - * @Serializer\VirtualProperty() - * - * @Serializer\Since("1.1") - */ + #[Serializer\VirtualProperty] + #[Serializer\Since(version: '1.1')] public function getAuthorFirstName(): ?string { return $this->author?->getFirstName(); } - /** - * @Serializer\VirtualProperty() - * - * @Serializer\Since("1.1") - */ + #[Serializer\VirtualProperty] + #[Serializer\Since(version: '1.1')] public function getAuthorLastName(): ?string { return $this->author?->getLastName(); diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithAlias.php b/tests/Application/src/Entity/CrudRoutes/BookWithAlias.php index a35ff87cc..2685434e9 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithAlias.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithAlias.php @@ -20,6 +20,7 @@ /** * @Serializer\ExclusionPolicy("all") */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', )] diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithCriteria.php b/tests/Application/src/Entity/CrudRoutes/BookWithCriteria.php index d79844b40..3033c5caa 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithCriteria.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithCriteria.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'criteria', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithExcept.php b/tests/Application/src/Entity/CrudRoutes/BookWithExcept.php index 9142329fc..f0b561c74 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithExcept.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithExcept.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'except', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithGrid.php b/tests/Application/src/Entity/CrudRoutes/BookWithGrid.php index fc0a704a4..7f0c40151 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithGrid.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithGrid.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'grid', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithLegacyAttribute.php b/tests/Application/src/Entity/CrudRoutes/BookWithLegacyAttribute.php index 8fff0821e..453ba7eca 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithLegacyAttribute.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithLegacyAttribute.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Component\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'legacy_attribute', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithOnly.php b/tests/Application/src/Entity/CrudRoutes/BookWithOnly.php index 64db0feed..4e8dc686b 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithOnly.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithOnly.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'only', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithPermission.php b/tests/Application/src/Entity/CrudRoutes/BookWithPermission.php index c043cebf4..3673dfe9c 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithPermission.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithPermission.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'permission', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithRedirect.php b/tests/Application/src/Entity/CrudRoutes/BookWithRedirect.php index ad2c7b01a..4a16ffed6 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithRedirect.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithRedirect.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'redirect', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithSection.php b/tests/Application/src/Entity/CrudRoutes/BookWithSection.php index 71ee253fe..4eb583ea1 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithSection.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithSection.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'admin', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithTemplate.php b/tests/Application/src/Entity/CrudRoutes/BookWithTemplate.php index 2a5ec9b89..0fdc825e8 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithTemplate.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithTemplate.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'template', diff --git a/tests/Application/src/Entity/CrudRoutes/BookWithVars.php b/tests/Application/src/Entity/CrudRoutes/BookWithVars.php index 7ce571b0c..c854ed49e 100644 --- a/tests/Application/src/Entity/CrudRoutes/BookWithVars.php +++ b/tests/Application/src/Entity/CrudRoutes/BookWithVars.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusCrudRoutes; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusCrudRoutes( alias: 'app.book', section: 'vars', diff --git a/tests/Application/src/Entity/Route/PublishBook.php b/tests/Application/src/Entity/Route/PublishBook.php index fb289d843..d5bff7233 100644 --- a/tests/Application/src/Entity/Route/PublishBook.php +++ b/tests/Application/src/Entity/Route/PublishBook.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'publish_book', path: '/books/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBook.php b/tests/Application/src/Entity/Route/ShowBook.php index ef3892498..151035529 100644 --- a/tests/Application/src/Entity/Route/ShowBook.php +++ b/tests/Application/src/Entity/Route/ShowBook.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithCriteria.php b/tests/Application/src/Entity/Route/ShowBookWithCriteria.php index 0753338bc..c07d6d22a 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithCriteria.php +++ b/tests/Application/src/Entity/Route/ShowBookWithCriteria.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_criteria', path: '/library/{libraryId}/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithHost.php b/tests/Application/src/Entity/Route/ShowBookWithHost.php index ffdd9df49..2d513d391 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithHost.php +++ b/tests/Application/src/Entity/Route/ShowBookWithHost.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_host', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithLegacyAttribute.php b/tests/Application/src/Entity/Route/ShowBookWithLegacyAttribute.php index 38e774cd6..41cd764af 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithLegacyAttribute.php +++ b/tests/Application/src/Entity/Route/ShowBookWithLegacyAttribute.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Component\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_legacy_attribute', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithMethods.php b/tests/Application/src/Entity/Route/ShowBookWithMethods.php index abe3b90ce..d23ea73c7 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithMethods.php +++ b/tests/Application/src/Entity/Route/ShowBookWithMethods.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_methods', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithOptions.php b/tests/Application/src/Entity/Route/ShowBookWithOptions.php index dc7ea94b5..1b68b63c0 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithOptions.php +++ b/tests/Application/src/Entity/Route/ShowBookWithOptions.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_options', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithPriority.php b/tests/Application/src/Entity/Route/ShowBookWithPriority.php index 9ab661ff0..f71a854ab 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithPriority.php +++ b/tests/Application/src/Entity/Route/ShowBookWithPriority.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_without_priority', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithRepository.php b/tests/Application/src/Entity/Route/ShowBookWithRepository.php index 90987dbde..5c2017ebe 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithRepository.php +++ b/tests/Application/src/Entity/Route/ShowBookWithRepository.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_repository', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithRequirements.php b/tests/Application/src/Entity/Route/ShowBookWithRequirements.php index dc72d9a7d..20b5d0936 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithRequirements.php +++ b/tests/Application/src/Entity/Route/ShowBookWithRequirements.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_requirements', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithSchemes.php b/tests/Application/src/Entity/Route/ShowBookWithSchemes.php index 318e60736..159117ac7 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithSchemes.php +++ b/tests/Application/src/Entity/Route/ShowBookWithSchemes.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_schemes', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithSerializationGroups.php b/tests/Application/src/Entity/Route/ShowBookWithSerializationGroups.php index b87b63282..ec60090f3 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithSerializationGroups.php +++ b/tests/Application/src/Entity/Route/ShowBookWithSerializationGroups.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_serialization_groups', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithSerializationVersion.php b/tests/Application/src/Entity/Route/ShowBookWithSerializationVersion.php index feb6d0658..b0174e774 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithSerializationVersion.php +++ b/tests/Application/src/Entity/Route/ShowBookWithSerializationVersion.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_serialization_version', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithTemplate.php b/tests/Application/src/Entity/Route/ShowBookWithTemplate.php index f29127989..da5f6c55d 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithTemplate.php +++ b/tests/Application/src/Entity/Route/ShowBookWithTemplate.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_template', path: '/book/{id}', diff --git a/tests/Application/src/Entity/Route/ShowBookWithVars.php b/tests/Application/src/Entity/Route/ShowBookWithVars.php index ef96faa59..c2eb134c2 100644 --- a/tests/Application/src/Entity/Route/ShowBookWithVars.php +++ b/tests/Application/src/Entity/Route/ShowBookWithVars.php @@ -17,9 +17,7 @@ use JMS\Serializer\Annotation as Serializer; use Sylius\Resource\Annotation\SyliusRoute; -/** - * @Serializer\ExclusionPolicy("all") - */ +#[Serializer\ExclusionPolicy(policy: 'ALL')] #[SyliusRoute( name: 'show_book_with_vars', path: '/book/{id}',