mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix tests for person json normalizer and residential address stuff
This commit is contained in:
@@ -33,6 +33,7 @@ use Symfony\Component\Serializer\Normalizer\ObjectToPopulateTrait;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function in_array;
|
||||
use function is_string;
|
||||
|
||||
/**
|
||||
* Serialize a Person entity.
|
||||
@@ -56,11 +57,11 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
private ResidentialAddressRepository $residentialAddressRepository;
|
||||
|
||||
public function __construct(
|
||||
ChillEntityRenderExtension $render,
|
||||
ChillEntityRenderExtension $render, /* TODO: replace by PersonRenderInterface, as sthis is the only one required */
|
||||
PersonRepository $repository,
|
||||
CenterResolverManagerInterface $centerResolverManager,
|
||||
ResidentialAddressRepository $residentialAddressRepository,
|
||||
PhoneNumberHelperInterface $phoneNumberHelper
|
||||
PhoneNumberHelperInterface $phoneNumberHelper /* TODO maybe not necessayr any more */
|
||||
) {
|
||||
$this->render = $render;
|
||||
$this->repository = $repository;
|
||||
@@ -189,6 +190,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
public function normalize($person, $format = null, array $context = [])
|
||||
{
|
||||
$groups = $context[AbstractNormalizer::GROUPS] ?? [];
|
||||
|
||||
if (is_string($groups)) {
|
||||
$groups = [$groups];
|
||||
}
|
||||
|
Reference in New Issue
Block a user