bug #24199 [DI] Fix non-instantiables auto-discovery (nicolas-grekas)

This PR was merged into the 3.3 branch.

Discussion
----------

[DI] Fix non-instantiables auto-discovery

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24195
| License       | MIT
| Doc PR        | -

Commits
-------

8b7c7c1 [DI] Fix non-instantiables auto-discovery
This commit is contained in:
Nicolas Grekas 2017-09-15 15:18:29 +02:00
commit 46811fdd01
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ abstract class FileLoader extends BaseFileLoader
throw new InvalidArgumentException(sprintf('Expected to find class "%s" in file "%s" while importing services from resource "%s", but it was not found! Check the namespace prefix used with the resource.', $class, $path, $pattern));
}
if (!$r->isInterface() && !$r->isTrait() && !$r->isAbstract()) {
if ($r->isInstantiable()) {
$classes[] = $class;
}
}