mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
sa: Fix all issues related to PHP versions and static-analysis.
This commit is contained in:
@@ -59,7 +59,7 @@ class PersonJsonNormalizer implements
|
||||
$this->centerResolverManager = $centerResolverManager;
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, ?string $format = null, array $context = [])
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
{
|
||||
$person = $this->extractObjectToPopulate($type, $context);
|
||||
|
||||
@@ -140,12 +140,13 @@ class PersonJsonNormalizer implements
|
||||
return $person;
|
||||
}
|
||||
|
||||
public function normalize($person, ?string $format = null, array $context = [])
|
||||
/**
|
||||
* @param Person $person
|
||||
*/
|
||||
public function normalize($person, $format = null, array $context = [])
|
||||
{
|
||||
/** @var Household $household */
|
||||
$household = $person->getCurrentHousehold();
|
||||
|
||||
/** @var Person $person */
|
||||
return [
|
||||
'type' => 'person',
|
||||
'id' => $person->getId(),
|
||||
@@ -164,12 +165,12 @@ class PersonJsonNormalizer implements
|
||||
];
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, ?string $format = null)
|
||||
public function supportsDenormalization($data, $type, $format = null)
|
||||
{
|
||||
return Person::class === $type && 'person' === ($data['type'] ?? null);
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null): bool
|
||||
public function supportsNormalization($data, $format = null): bool
|
||||
{
|
||||
return $data instanceof Person && 'json' === $format;
|
||||
}
|
||||
|
Reference in New Issue
Block a user