Skip to content

Commit

Permalink
Fix config + php compat
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Aug 24, 2024
1 parent 3b42fee commit 285e688
Show file tree
Hide file tree
Showing 2 changed files with 268 additions and 81 deletions.
10 changes: 6 additions & 4 deletions Model/Config/Source/EraseComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use function array_keys;
use function array_map;
use function array_merge;
use function array_unique;
use function array_values;

class EraseComponents implements OptionSourceInterface
{
Expand All @@ -40,18 +42,18 @@ public function toOptionArray(): array
*/
private function retrieveDelegateProcessors(): array
{
return array_keys(
return array_unique(
array_merge(
[],
...array_map(
fn (string $resolver): mixed => $this->retrieveArgument($resolver, 'processors'),
$this->retrieveArgument($this->factoryClassName, 'processorResolvers', [])
fn (string $resolver): array => array_keys($this->retrieveArgument($resolver, 'processors')),
array_values($this->retrieveArgument($this->factoryClassName, 'processorResolvers', []))
)
)
);
}

private function retrieveArgument(string $className, string $argumentName, mixed $defaultValue = null): mixed
private function retrieveArgument(string $className, string $argumentName, mixed $defaultValue = null): array
{
$arguments = $this->objectManagerConfig->getArguments(
$this->objectManagerConfig->getPreference($className)
Expand Down
Loading

0 comments on commit 285e688

Please sign in to comment.