bug #30616 Fix case when multiple loaders are providing paths for the same namespace (yceruto)

This PR was merged into the 4.2 branch.

Discussion
----------

Fix case when multiple loaders are providing paths for the same namespace

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT

Fixes @stof https://github.com/symfony/symfony/pull/30440#discussion_r267316027

Let me know if a test case is necessary for this.

Cheers!

Commits
-------

393d7280e5 Fix case when multiple loaders are providing paths for the same namespace
This commit is contained in:
Fabien Potencier 2019-03-20 21:18:35 +01:00
commit b29686029a

View File

@ -264,7 +264,7 @@ EOF
$namespace = '@'.$namespace;
}
$loaderPaths[$namespace] = $paths;
$loaderPaths[$namespace] = array_merge($loaderPaths[$namespace] ?? [], $paths);
}
}