Skip to content

Commit e7b8d50

Browse files
[Config] don't throw on missing excluded paths
1 parent 7b3f47e commit e7b8d50

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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
}

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)