mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-21 22:24:59 +00:00
Update DateNormalizer
: Add return type hints for denormalize
and normalize
methods
This commit is contained in:
@@ -22,7 +22,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly RequestStack $requestStack, private readonly ParameterBagInterface $parameterBag) {}
|
public function __construct(private readonly RequestStack $requestStack, private readonly ParameterBagInterface $parameterBag) {}
|
||||||
|
|
||||||
public function denormalize($data, $type, $format = null, array $context = [])
|
public function denormalize($data, $type, $format = null, array $context = []): ?DateTimeInterface
|
||||||
{
|
{
|
||||||
if (null === $data) {
|
if (null === $data) {
|
||||||
return null;
|
return null;
|
||||||
@@ -51,7 +51,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function normalize($date, $format = null, array $context = [])
|
public function normalize($date, $format = null, array $context = []): array
|
||||||
{
|
{
|
||||||
/* @var DateTimeInterface $date */
|
/* @var DateTimeInterface $date */
|
||||||
switch ($format) {
|
switch ($format) {
|
||||||
|
Reference in New Issue
Block a user