mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
DX: use array spred instead of array_merge
This commit is contained in:
@@ -179,28 +179,25 @@ final class PersonContext implements PersonContextInterface
|
||||
'data' => $this->translatableStringHelper->localize($template->getName()),
|
||||
]);
|
||||
|
||||
$thirdParties = array_merge(
|
||||
array_values(
|
||||
array_filter(
|
||||
array_map(
|
||||
fn (ResidentialAddress $r): ?ThirdParty => $r->getHostThirdParty(),
|
||||
$this
|
||||
->residentialAddressRepository
|
||||
->findCurrentResidentialAddressByPerson($entity)
|
||||
)
|
||||
)
|
||||
),
|
||||
array_values(
|
||||
array_filter(
|
||||
array_map(
|
||||
fn (PersonResource $r): ?ThirdParty => $r->getThirdParty(),
|
||||
$entity->getResources()->filter(
|
||||
static fn (PersonResource $r): bool => null !== $r->getThirdParty()
|
||||
)->toArray()
|
||||
)
|
||||
$thirdParties = [...array_values(
|
||||
array_filter(
|
||||
array_map(
|
||||
fn (ResidentialAddress $r): ?ThirdParty => $r->getHostThirdParty(),
|
||||
$this
|
||||
->residentialAddressRepository
|
||||
->findCurrentResidentialAddressByPerson($entity)
|
||||
)
|
||||
)
|
||||
);
|
||||
), ...array_values(
|
||||
array_filter(
|
||||
array_map(
|
||||
fn (PersonResource $r): ?ThirdParty => $r->getThirdParty(),
|
||||
$entity->getResources()->filter(
|
||||
static fn (PersonResource $r): bool => null !== $r->getThirdParty()
|
||||
)->toArray()
|
||||
)
|
||||
)
|
||||
)];
|
||||
|
||||
if ($options['thirdParty'] ?? false) {
|
||||
$builder->add('thirdParty', EntityType::class, [
|
||||
|
Reference in New Issue
Block a user