Feature: add thirdParty choice in docgen context - use array_values

This commit is contained in:
nobohan
2023-05-25 13:58:46 +02:00
parent 9593cfde36
commit 1b0569c974
3 changed files with 31 additions and 23 deletions

View File

@@ -214,13 +214,15 @@ class AccompanyingPeriodContext implements
}
$thirdParties = array_merge(
array_filter([$entity->getRequestorThirdParty()]),
array_filter(array_values([$entity->getRequestorThirdParty()])),
array_filter(
array_map(
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
$entity->getResources()->filter(
static fn (Resource $r): bool => null !== $r->getThirdParty()
)->toArray()
array_values(
array_map(
fn (Resource $r): ?ThirdParty => $r->getThirdParty(),
$entity->getResources()->filter(
static fn (Resource $r): bool => null !== $r->getThirdParty()
)->toArray()
)
)
)
);