mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-19 13:15:00 +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 denormalize($data, $type, $format = null, array $context = [])
|
||||
public function denormalize($data, $type, $format = null, array $context = []): ?DateTimeInterface
|
||||
{
|
||||
if (null === $data) {
|
||||
return null;
|
||||
@@ -51,7 +51,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function normalize($date, $format = null, array $context = [])
|
||||
public function normalize($date, $format = null, array $context = []): array
|
||||
{
|
||||
/* @var DateTimeInterface $date */
|
||||
switch ($format) {
|
||||
|
Reference in New Issue
Block a user