Merge branch 'master' into upgrade-php82

This commit is contained in:
2023-02-09 18:37:30 +01:00
43 changed files with 1152 additions and 122 deletions

View File

@@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Serializer\Normalizer;
use Chill\BudgetBundle\Service\Summary\SummaryBudgetInterface;
use Chill\DocGeneratorBundle\Serializer\Helper\NormalizeNullValueHelper;
use Chill\MainBundle\Entity\Address;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\Household\Household;
@@ -87,6 +88,7 @@ class PersonDocGenNormalizer implements
$dateContext['docgen:expects'] = DateTimeInterface::class;
$addressContext = array_merge($context, ['docgen:expects' => Address::class]);
$phonenumberContext = array_merge($context, ['docgen:expects' => PhoneNumber::class]);
$centerContext = array_merge($context, ['docgen:expects' => Center::class]);
$personResourceContext = array_merge($context, [
'docgen:expects' => Person\PersonResource::class,
// we simplify the list of attributes for the embedded persons
@@ -139,6 +141,7 @@ class PersonDocGenNormalizer implements
'numberOfChildren' => (string) $person->getNumberOfChildren(),
'address' => $this->normalizer->normalize($person->getCurrentPersonAddress(), $format, $addressContext),
'resources' => $this->normalizer->normalize($person->getResources(), $format, $personResourceContext),
'center' => $this->normalizer->normalize($person->getCenter(), $format, $centerContext),
];
if ($context['docgen:person:with-household'] ?? false) {
@@ -240,6 +243,7 @@ class PersonDocGenNormalizer implements
$attributes = [
'id', 'firstName', 'lastName', 'age', 'altNames', 'text',
'center' => Center::class,
'civility' => Civility::class,
'birthdate' => DateTimeInterface::class,
'deathdate' => DateTimeInterface::class,