Skip to content

Commit b6195fe

Browse files
[DependencyInjection] Fix setting the class of auto-discovery services
1 parent 143f83b commit b6195fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Loader/FileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public function registerClasses(Definition $prototype, string $namespace, string
138138

139139
continue;
140140
}
141+
$definition->setClass($class);
141142
foreach (class_implements($class, false) as $interface) {
142143
$this->singlyImplemented[$interface] = ($this->singlyImplemented[$interface] ?? $class) !== $class ? false : $class;
143144
}
@@ -253,7 +254,7 @@ private function findClasses(string $namespace, string $pattern, array $excludeP
253254
foreach ($excludePaths as $path => $_) {
254255
$class = $namespace.ltrim(str_replace('/', '\\', substr($path, $prefixLen, str_ends_with($path, '.php') ? -4 : null)), '\\');
255256
if (!$this->container->has($class)) {
256-
$this->container->register($class)
257+
$this->container->register($class, $class)
257258
->setAbstract(true)
258259
->addTag('container.excluded', $attributes);
259260
}

0 commit comments

Comments
 (0)