Skip to content

Commit 4f865c7

Browse files
committed
add files used in FileResource objects
Starting with Symfony 3.1, the constructor of the `FileResource` class will throw an exception when the passed file does not exist.
1 parent a842eda commit 4f865c7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

+3-1
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)