Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 212841b

Browse files
bug #35772 [Config] don't throw on missing excluded paths (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Config] don't throw on missing excluded paths | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 2f65a7a [Config] don't throw on missing excluded paths
2 parents a81cbc9 + 2f65a7a commit 212841b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Symfony/Component/DependencyInjection/Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private function findClasses($namespace, $pattern, $excludePattern)
110110
$excludePrefix = null;
111111
if ($excludePattern) {
112112
$excludePattern = $parameterBag->unescapeValue($parameterBag->resolveValue($excludePattern));
113-
foreach ($this->glob($excludePattern, true, $resource) as $path => $info) {
113+
foreach ($this->glob($excludePattern, true, $resource, true) as $path => $info) {
114114
if (null === $excludePrefix) {
115115
$excludePrefix = $resource->getPrefix();
116116
}

src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ public function testRegisterClassesWithExclude()
134134
],
135135
array_keys($container->getAliases())
136136
);
137+
138+
$loader->registerClasses(
139+
new Definition(),
140+
'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\\',
141+
'Prototype/*',
142+
'Prototype/NotExistingDir'
143+
);
137144
}
138145

139146
public function testNestedRegisterClasses()

0 commit comments

Comments
 (0)