Skip to content

Commit 285e688

Browse files
committed
Fix config + php compat
1 parent 3b42fee commit 285e688

File tree

2 files changed

+268
-81
lines changed

2 files changed

+268
-81
lines changed

Model/Config/Source/EraseComponents.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use function array_keys;
1515
use function array_map;
1616
use function array_merge;
17+
use function array_unique;
18+
use function array_values;
1719

1820
class EraseComponents implements OptionSourceInterface
1921
{
@@ -40,18 +42,18 @@ public function toOptionArray(): array
4042
*/
4143
private function retrieveDelegateProcessors(): array
4244
{
43-
return array_keys(
45+
return array_unique(
4446
array_merge(
4547
[],
4648
...array_map(
47-
fn (string $resolver): mixed => $this->retrieveArgument($resolver, 'processors'),
48-
$this->retrieveArgument($this->factoryClassName, 'processorResolvers', [])
49+
fn (string $resolver): array => array_keys($this->retrieveArgument($resolver, 'processors')),
50+
array_values($this->retrieveArgument($this->factoryClassName, 'processorResolvers', []))
4951
)
5052
)
5153
);
5254
}
5355

54-
private function retrieveArgument(string $className, string $argumentName, mixed $defaultValue = null): mixed
56+
private function retrieveArgument(string $className, string $argumentName, mixed $defaultValue = null): array
5557
{
5658
$arguments = $this->objectManagerConfig->getArguments(
5759
$this->objectManagerConfig->getPreference($className)

0 commit comments

Comments
 (0)