mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-25 16:14:59 +00:00
Add serializer groups to SignedUrl and SignedUrlPost classes, include tests
Serializer groups have been added to the SignedUrl and SignedUrlPost classes to ensure correct serialization. Two new test files were also included: SignedUrlNormalizerTest and SignedUrlPostNormalizerTest which test the normalization of instances of the classes.
This commit is contained in:
@@ -11,11 +11,28 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\DocStoreBundle\AsyncUpload;
|
||||
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
readonly class SignedUrl
|
||||
{
|
||||
public function __construct(
|
||||
/**
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
public string $method,
|
||||
|
||||
/**
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
public string $url,
|
||||
public \DateTimeImmutable $expires,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
public function getExpires(): int
|
||||
{
|
||||
return $this->expires->getTimestamp();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user