mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-12 07:08:25 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -40,19 +40,13 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private ClassMetadataFactoryInterface $classMetadataFactory;
|
||||
|
||||
private PropertyAccessor $propertyAccess;
|
||||
|
||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||
|
||||
public function __construct(
|
||||
ClassMetadataFactoryInterface $classMetadataFactory,
|
||||
TranslatableStringHelperInterface $translatableStringHelper
|
||||
private ClassMetadataFactoryInterface $classMetadataFactory,
|
||||
private TranslatableStringHelperInterface $translatableStringHelper
|
||||
) {
|
||||
$this->classMetadataFactory = $classMetadataFactory;
|
||||
$this->propertyAccess = PropertyAccess::createPropertyAccessor();
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
public function normalize($object, $format = null, array $context = [])
|
||||
@@ -66,7 +60,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
if (!$this->classMetadataFactory->hasMetadataFor($classMetadataKey)) {
|
||||
throw new LogicException(sprintf(
|
||||
'This object does not have metadata: %s. Add groups on this entity to allow to serialize with the format %s and groups %s',
|
||||
is_object($object) ? get_class($object) : '(todo' /*$context['docgen:expects'],*/ ,
|
||||
is_object($object) ? $object::class : '(todo' /*$context['docgen:expects'],*/ ,
|
||||
$format,
|
||||
implode(', ', ($context['groups'] ?? []))
|
||||
));
|
||||
@@ -199,10 +193,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
return $normalizer->normalize($keys, $format, $context, $metadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $format
|
||||
*/
|
||||
private function normalizeNullOutputValue($format, array $context, AttributeMetadata $attribute, ReflectionClass $reflection)
|
||||
private function normalizeNullOutputValue(mixed $format, array $context, AttributeMetadata $attribute, ReflectionClass $reflection)
|
||||
{
|
||||
$type = $this->getExpectedType($attribute, $reflection);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user