From 82dbe45be52f4884da3be7a21dbc9bec525843e9 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 5 Jun 2015 11:00:12 -0400 Subject: [PATCH] Don't Pass a Filename to Yaml::parse Instead just `file_get_contents` the configuration file and pass the string to `Yaml::parse`. Symfony 2.2 deprecated passing a filename into parse and Symfony 2.7 adds a deprecation warning to the method. --- src/Igorw/Silex/YamlConfigDriver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Igorw/Silex/YamlConfigDriver.php b/src/Igorw/Silex/YamlConfigDriver.php index 5b849a9..9da7910 100644 --- a/src/Igorw/Silex/YamlConfigDriver.php +++ b/src/Igorw/Silex/YamlConfigDriver.php @@ -11,7 +11,8 @@ public function load($filename) if (!class_exists('Symfony\\Component\\Yaml\\Yaml')) { throw new \RuntimeException('Unable to read yaml as the Symfony Yaml Component is not installed.'); } - $config = Yaml::parse($filename); + + $config = Yaml::parse(file_get_contents($filename)); return $config ?: array(); }