From 4f865c758ae5c4fc1c320a032c7b7e008418e34c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 3 Feb 2016 18:21:36 +0100 Subject: [PATCH] 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. --- .../Component/DependencyInjection/ContainerBuilder.php | 4 +++- src/Symfony/Component/Routing/Tests/Fixtures/bar.xml | 0 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Component/Routing/Tests/Fixtures/bar.xml diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 6c52c47b65..3a72208c3e 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -243,7 +243,9 @@ class ContainerBuilder extends Container implements TaggedContainerInterface } do { - $this->addResource(new FileResource($class->getFileName())); + if (is_file($class->getFileName())) { + $this->addResource(new FileResource($class->getFileName())); + } } while ($class = $class->getParentClass()); return $this; diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/bar.xml b/src/Symfony/Component/Routing/Tests/Fixtures/bar.xml new file mode 100644 index 0000000000..e69de29bb2