Rector changes and immplementations of required methods

This commit is contained in:
2025-05-22 17:47:07 +02:00
parent 053b92b77c
commit 17db59d221
1138 changed files with 2656 additions and 2616 deletions

View File

@@ -51,7 +51,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
private readonly PhoneNumberHelperInterface $phoneNumberHelper,
) {}
public function denormalize($data, $type, $format = null, array $context = [])
public function denormalize($data, $type, $format = null, array $context = []): mixed
{
$person = $this->extractObjectToPopulate($type, $context);
@@ -178,7 +178,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
* @param Person $person
* @param string|null $format
*/
public function normalize($person, $format = null, array $context = [])
public function normalize($person, $format = null, array $context = []): string|int|float|bool|\ArrayObject|array|null
{
$groups = $context[AbstractNormalizer::GROUPS] ?? [];
@@ -215,12 +215,12 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
null];
}
public function supportsDenormalization($data, $type, $format = null)
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
{
return Person::class === $type && 'person' === ($data['type'] ?? null);
}
public function supportsNormalization($data, $format = null): bool
public function supportsNormalization($data, $format = null, array $context = []): bool
{
return $data instanceof Person && 'json' === $format;
}