Skip to content

Commit

Permalink
Merge pull request #90 from wunderio/fix-autoloader
Browse files Browse the repository at this point in the history
Fix Psalm with Drupal9.5
  • Loading branch information
Juhani-moilanen authored Feb 10, 2023
2 parents 0af157c + 6563ffe commit 87129b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Drupal/DrupalAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ public function register(string $drupalRoot): void {
continue;
}
foreach ($yaml['services'] as $serviceId => $serviceDefinition) {
// Check if this is an alias shortcut.
// @link https://symfony.com/doc/4.4/service_container/alias_private.html#aliasing
if (is_string($serviceDefinition)) {
$serviceDefinition = [
'alias' => str_replace('@', '', $serviceDefinition),
];
}
// Prevent \Nette\DI\ContainerBuilder::completeStatement from
// array_walk_recursive into the arguments
// and thinking these are real services for PHPStan's container.
Expand Down

0 comments on commit 87129b5

Please sign in to comment.