mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
sa: Fix all issues related to PHP versions and static-analysis.
This commit is contained in:
@@ -36,7 +36,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
$this->parameterBag = $parameterBag;
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, ?string $format = null, array $context = [])
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
{
|
||||
if (null === $data) {
|
||||
return null;
|
||||
@@ -54,7 +54,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
throw new UnexpectedValueException();
|
||||
}
|
||||
|
||||
public function normalize($date, ?string $format = null, array $context = [])
|
||||
public function normalize($date, $format = null, array $context = [])
|
||||
{
|
||||
/** @var DateTimeInterface $date */
|
||||
switch ($format) {
|
||||
@@ -91,7 +91,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
}
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, ?string $format = null): bool
|
||||
public function supportsDenormalization($data, $type, $format = null): bool
|
||||
{
|
||||
return DateTimeInterface::class === $type
|
||||
|| DateTime::class === $type
|
||||
@@ -99,7 +99,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
|| (is_array($data) && array_key_exists('datetime', $data));
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
|
||||
public function supportsNormalization($data, $format = null, array $context = []): bool
|
||||
{
|
||||
if ('json' === $format) {
|
||||
return $data instanceof DateTimeInterface;
|
||||
|
Reference in New Issue
Block a user