From 610239930bb7318ecd6f2f19729a33faa1e6b41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Jun 2024 13:43:48 +0200 Subject: [PATCH] Add serialization groups to PDFPage and PDFSignatureZone properties The Symfony Serializer groups annotation has been added to all properties of the PDFPage and PDFSignatureZone classes. This change allows the serialization and deserialization process to be group-specific, ensuring only relevant data is processed during these operations. --- .../ChillDocStoreBundle/Service/Signature/PDFPage.php | 5 +++++ .../Service/Signature/PDFSignatureZone.php | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFPage.php b/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFPage.php index 138c4e1c8..ffe6bbb17 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFPage.php +++ b/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFPage.php @@ -11,11 +11,16 @@ declare(strict_types=1); namespace Chill\DocStoreBundle\Service\Signature; +use Symfony\Component\Serializer\Annotation\Groups; + final readonly class PDFPage { public function __construct( + #[Groups(['read'])] public int $index, + #[Groups(['read'])] public float $width, + #[Groups(['read'])] public float $height, ) {} diff --git a/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFSignatureZone.php b/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFSignatureZone.php index 515356e52..bdb4dcd65 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFSignatureZone.php +++ b/src/Bundle/ChillDocStoreBundle/Service/Signature/PDFSignatureZone.php @@ -11,13 +11,20 @@ declare(strict_types=1); namespace Chill\DocStoreBundle\Service\Signature; +use Symfony\Component\Serializer\Annotation\Groups; + final readonly class PDFSignatureZone { public function __construct( + #[Groups(['read'])] public float $x, + #[Groups(['read'])] public float $y, + #[Groups(['read'])] public float $height, + #[Groups(['read'])] public float $width, + #[Groups(['read'])] public PDFPage $PDFPage, ) {}