mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -14,7 +14,6 @@ namespace Chill\MainBundle\Serializer\Normalizer;
|
||||
use Chill\DocGeneratorBundle\Serializer\Helper\NormalizeNullValueHelper;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Templating\Entity\AddressRender;
|
||||
use DateTimeInterface;
|
||||
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
|
||||
@@ -43,15 +42,15 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
|
||||
'buildingName',
|
||||
'distribution',
|
||||
'extra',
|
||||
'validFrom' => DateTimeInterface::class,
|
||||
'validTo' => DateTimeInterface::class,
|
||||
'validFrom' => \DateTimeInterface::class,
|
||||
'validTo' => \DateTimeInterface::class,
|
||||
'confidential',
|
||||
];
|
||||
|
||||
public function __construct(private readonly AddressRender $addressRender) {}
|
||||
|
||||
/**
|
||||
* @param Address $address
|
||||
* @param Address $address
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($address, $format = null, array $context = [])
|
||||
@@ -100,7 +99,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
|
||||
);
|
||||
$data['isNoAddress'] = $address->isNoAddress();
|
||||
} elseif ('docgen' === $format) {
|
||||
$dateContext = array_merge($context, ['docgen:expects' => DateTimeInterface::class]);
|
||||
$dateContext = array_merge($context, ['docgen:expects' => \DateTimeInterface::class]);
|
||||
$data['validFrom'] = $this->normalizer->normalize($address->getValidFrom(), $format, $dateContext);
|
||||
$data['validTo'] = $this->normalizer->normalize($address->getValidTo(), $format, $dateContext);
|
||||
}
|
||||
|
Reference in New Issue
Block a user