mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
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.
34 lines
798 B
PHP
34 lines
798 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
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,
|
|
) {}
|
|
|
|
public function equals(self $page): bool
|
|
{
|
|
return $page->index === $this->index
|
|
&& round($page->width, 2) === round($this->width, 2)
|
|
&& round($page->height, 2) === round($this->height, 2);
|
|
}
|
|
}
|