8000 bug #35269 [HttpKernel][FileLocator] Fix deprecation message (fancyweb) · symfony/symfony@62c4608 · GitHub
[go: up one dir, main page]

Skip to content

Commit 62c4608

Browse files
bug #35269 [HttpKernel][FileLocator] Fix deprecation message (fancyweb)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel][FileLocator] Fix deprecation message | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Ref #34886 `$deprecatedPath` is the foreach value so it only works if the last element triggers the deprecation, otherwise the value is wrong. Commits ------- 18ce839 [HttpKernel][FileLocator] Fix deprecation message
2 parents e587194 + 18ce839 commit 62c4608

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/HttpKernel/Config/FileLocator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function locate($file, $currentPath = null, $first = true)
6565
|| (\strlen($file) > 3 && ctype_alpha($file[0]) && ':' === $file[1] && ('\\' === $file[2] || '/' === $file[2]))
6666
|| null !== parse_url($file, PHP_URL_SCHEME)
6767
)) {
68-
$triggerDeprecation = false;
68+
$deprecation = false;
6969

7070
// no need to trigger deprecations when the loaded file is given as absolute path
7171
foreach ($this->paths as $deprecatedPath) {
@@ -75,13 +75,13 @@ public function locate($file, $currentPath = null, $first = true)
7575
}
7676

7777
if (0 === strpos($location, $deprecatedPath) && (null === $currentPath || false === strpos($location, $currentPath))) {
78-
$triggerDeprecation = true;
78+
$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);
7979
}
8080
}
8181
}
8282

83-
if ($triggerDeprecation) {
84-
@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);
83+
if ($deprecation) {
84+
@trigger_error($deprecation, E_USER_DEPRECATED);
8585
}
8686
}
8787

0 commit comments

Comments
 (0)
0