diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php index 35b5beaaa3..38c85ec63e 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php @@ -130,8 +130,11 @@ protected function processServiceCollectorPass(array $pass, $consumer_id, Contai $priority_pos = NULL; $extra_params = []; foreach ($params as $pos => $param) { - if ($param->getClass()) { - $interface = $param->getClass(); + /** @var \ReflectionType $type */ + $type = $param->getType(); + $class = NULL !== $type && !$type->isBuiltin() ? $type->getName() : NULL; + if (NULL !== $class) { + $interface = $class; } elseif ($param->getName() === 'id') { $id_pos = $pos; @@ -152,7 +155,6 @@ protected function processServiceCollectorPass(array $pass, $consumer_id, Contai $method_name, ])); } - $interface = $interface->getName(); // Find all tagged handlers. $handlers = [];