mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: use array spred instead of array_merge
This commit is contained in:
parent
80dfa092db
commit
9c109d2efd
@ -213,17 +213,14 @@ class AccompanyingPeriodContext implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$thirdParties = array_merge(
|
$thirdParties = [...array_values(array_filter([$entity->getRequestorThirdParty()])), ...array_values(array_filter(
|
||||||
array_values(array_filter([$entity->getRequestorThirdParty()])),
|
array_map(
|
||||||
array_values(array_filter(
|
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
|
||||||
array_map(
|
$entity->getResources()->filter(
|
||||||
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
|
static fn (Resource $r): bool => null !== $r->getThirdParty()
|
||||||
$entity->getResources()->filter(
|
)->toArray()
|
||||||
static fn (Resource $r): bool => null !== $r->getThirdParty()
|
)
|
||||||
)->toArray()
|
))];
|
||||||
)
|
|
||||||
))
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($options['thirdParty'] ?? false) {
|
if ($options['thirdParty'] ?? false) {
|
||||||
$builder->add('thirdParty', EntityType::class, [
|
$builder->add('thirdParty', EntityType::class, [
|
||||||
|
@ -116,20 +116,16 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
|||||||
{
|
{
|
||||||
$this->accompanyingPeriodWorkContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriodWork());
|
$this->accompanyingPeriodWorkContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriodWork());
|
||||||
|
|
||||||
$thirdParties = array_merge(
|
$thirdParties = [...array_values(array_filter($entity->getAccompanyingPeriodWork()->getThirdParties()->toArray())), ...array_values(array_filter([$entity->getAccompanyingPeriodWork()->getHandlingThierParty()])), ...array_values(
|
||||||
array_values(array_filter($entity->getAccompanyingPeriodWork()->getThirdParties()->toArray())),
|
array_filter(
|
||||||
array_values(array_filter([$entity->getAccompanyingPeriodWork()->getHandlingThierParty()])),
|
array_map(
|
||||||
array_values(
|
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
|
||||||
array_filter(
|
$entity->getAccompanyingPeriodWork()->getAccompanyingPeriod()->getResources()->filter(
|
||||||
array_map(
|
static fn (Resource $r): bool => null !== $r->getThirdParty()
|
||||||
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
|
)->toArray()
|
||||||
$entity->getAccompanyingPeriodWork()->getAccompanyingPeriod()->getResources()->filter(
|
|
||||||
static fn (Resource $r): bool => null !== $r->getThirdParty()
|
|
||||||
)->toArray()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
)];
|
||||||
|
|
||||||
$options = $template->getOptions();
|
$options = $template->getOptions();
|
||||||
if ($options['thirdParty'] ?? false) {
|
if ($options['thirdParty'] ?? false) {
|
||||||
|
@ -179,28 +179,25 @@ final class PersonContext implements PersonContextInterface
|
|||||||
'data' => $this->translatableStringHelper->localize($template->getName()),
|
'data' => $this->translatableStringHelper->localize($template->getName()),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$thirdParties = array_merge(
|
$thirdParties = [...array_values(
|
||||||
array_values(
|
array_filter(
|
||||||
array_filter(
|
array_map(
|
||||||
array_map(
|
fn (ResidentialAddress $r): ?ThirdParty => $r->getHostThirdParty(),
|
||||||
fn (ResidentialAddress $r): ?ThirdParty => $r->getHostThirdParty(),
|
$this
|
||||||
$this
|
->residentialAddressRepository
|
||||||
->residentialAddressRepository
|
->findCurrentResidentialAddressByPerson($entity)
|
||||||
->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()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
), ...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) {
|
if ($options['thirdParty'] ?? false) {
|
||||||
$builder->add('thirdParty', EntityType::class, [
|
$builder->add('thirdParty', EntityType::class, [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user