From 18ce8399d2820239970e1e85c7d05fd248984890 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Wed, 8 Jan 2020 19:32:07 +0100 Subject: [PATCH] [HttpKernel][FileLocator] Fix deprecation message --- src/Symfony/Component/HttpKernel/Config/FileLocator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Config/FileLocator.php b/src/Symfony/Component/HttpKernel/Config/FileLocator.php index fecdf223b7..03dfe3de31 100644 --- a/src/Symfony/Component/HttpKernel/Config/FileLocator.php +++ b/src/Symfony/Component/HttpKernel/Config/FileLocator.php @@ -65,7 +65,7 @@ class FileLocator extends BaseFileLocator || (\strlen($file) > 3 && ctype_alpha($file[0]) && ':' === $file[1] && ('\\' === $file[2] || '/' === $file[2])) || null !== parse_url($file, PHP_URL_SCHEME) )) { - $triggerDeprecation = false; + $deprecation = false; // no need to trigger deprecations when the loaded file is given as absolute path foreach ($this->paths as $deprecatedPath) { @@ -75,13 +75,13 @@ class FileLocator extends BaseFileLocator } if (0 === strpos($location, $deprecatedPath) && (null === $currentPath || false === strpos($location, $currentPath))) { - $triggerDeprecation = true; + $deprecation = sprintf('Loading the file "%s" from the global resource directory "%s" is deprecated since Symfony 4.4 and will be removed in 5.0.', $file, $deprecatedPath); } } } - if ($triggerDeprecation) { - @trigger_error(sprintf('Loading the file "%s" from the global resource directory "%s" is deprecated since Symfony 4.4 and will be removed in 5.0.', $file, $deprecatedPath), E_USER_DEPRECATED); + if ($deprecation) { + @trigger_error($deprecation, E_USER_DEPRECATED); } }