DX: use array spred instead of array_merge

This commit is contained in:
2023-05-31 23:47:02 +02:00
parent 80dfa092db
commit 9c109d2efd
3 changed files with 33 additions and 43 deletions

View File

@@ -213,17 +213,14 @@ class AccompanyingPeriodContext implements
}
}
$thirdParties = array_merge(
array_values(array_filter([$entity->getRequestorThirdParty()])),
array_values(array_filter(
array_map(
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
$entity->getResources()->filter(
static fn (Resource $r): bool => null !== $r->getThirdParty()
)->toArray()
)
))
);
$thirdParties = [...array_values(array_filter([$entity->getRequestorThirdParty()])), ...array_values(array_filter(
array_map(
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
$entity->getResources()->filter(
static fn (Resource $r): bool => null !== $r->getThirdParty()
)->toArray()
)
))];
if ($options['thirdParty'] ?? false) {
$builder->add('thirdParty', EntityType::class, [