diff --git a/rules-tests/Transform/Rector/Class_/AddInterfaceByParentRector/config/configured_rule.php b/rules-tests/Transform/Rector/Class_/AddInterfaceByParentRector/config/configured_rule.php index a9db765b121..30ee11e6b08 100644 --- a/rules-tests/Transform/Rector/Class_/AddInterfaceByParentRector/config/configured_rule.php +++ b/rules-tests/Transform/Rector/Class_/AddInterfaceByParentRector/config/configured_rule.php @@ -10,9 +10,7 @@ return static function (ContainerConfigurator $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddInterfaceByParentRector::class) - ->call('configure', [[ - AddInterfaceByParentRector::INTERFACE_BY_PARENT => [ - SomeParent::class => SomeInterface::class, - ], - ]]); + ->configure([ + SomeParent::class => SomeInterface::class, + ]); }; diff --git a/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php b/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php index ffafcc1da0c..fccfff35ba7 100644 --- a/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php +++ b/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php @@ -107,10 +107,11 @@ public function refactor(Node $node): ?Node public function configure(array $configuration): void { $interfaceByParent = $configuration[self::INTERFACE_BY_PARENT] ?? ($configuration ?: []); + + Assert::isArray($interfaceByParent); Assert::allString(array_keys($interfaceByParent)); - Assert::allIsArray($interfaceByParent); + Assert::allString($interfaceByParent); - /** @var array $interfaceByParent */ $this->interfaceByParent = $interfaceByParent; } }