mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 17:15:02 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user