Skip to content

Commit c7b5786

Browse files
committed
Fatal error when service argument is array
1 parent 6f5d8de commit c7b5786

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/DependencyInjection/DrupalExtension.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,13 @@ public function loadConfiguration(): void
120120
// Prevent \Nette\DI\ContainerBuilder::completeStatement from array_walk_recursive into the arguments
121121
// and thinking these are real services for PHPStan's container.
122122
if (isset($serviceDefinition['arguments']) && is_array($serviceDefinition['arguments'])) {
123-
array_walk($serviceDefinition['arguments'], function (string &$argument) : void {
124-
$argument = str_replace('@', '', $argument);
123+
array_walk($serviceDefinition['arguments'], function (&$argument) : void {
124+
if (is_array($argument)) {
125+
// @todo fix for @http_kernel.controller.argument_metadata_factory
126+
$argument = '';
127+
} else {
128+
$argument = str_replace('@', '', $argument);
129+
}
125130
});
126131
}
127132
unset($serviceDefinition['tags']);

0 commit comments

Comments
 (0)