8000 bug #17672 [DependencyInjection][Routing] add files used in FileResou… · symfony/symfony@876bad9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 876bad9

Browse files
bug #17672 [DependencyInjection][Routing] add files used in FileResource objects (xabbuh)
This PR was merged into the 2.3 branch. Discussion ---------- [DependencyInjection][Routing] add files used in FileResource objects | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17598 (comment) | License | MIT | Doc PR | Starting with Symfony 3.1, the constructor of the `FileResource` class will throw an exception when the passed file does not exist. Commits ------- 4f865c7 add files used in FileResource objects
2 parents a842eda + 4f865c7 commit 876bad9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ public function addClassResource(\ReflectionClass $class)
243243
}
244244

245245
do {
246-
$this->addResource(new FileResource($class->getFileName()));
246+
if (is_file($class->getFileName())) {
247+
$this->addResource(new FileResource($class->getFileName()));
248+
}
247249
} while ($class = $class->getParentClass());
248250

249251
return $this;

src/Symfony/Component/Routing/Tests/Fixtures/bar.xml

Whitespace-only changes.

0 commit comments

Comments
 (0)
0