apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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);
}