-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel][FileLocator] Fix deprecation message #35269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HttpKernel][FileLocator] Fix deprecation message #35269
Conversation
@@ -75,13 +75,13 @@ public function locate($file, $currentPath = null, $first = true) | ||
} | ||
|
||
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative: $triggerDeprecation = $deprecatedPath;
and then use $triggerDeprecation
later but that seemed less readable.
@@ -75,13 +75,13 @@ public function locate($file, $currentPath = null, $first = true) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be a continue
statement instead of return $locations
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #34886 (comment) for the explanation I guess.
Thank you @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
Ref #34886
$deprecatedPath
is the foreach value so it only works if the last element triggers the deprecation, otherwise the value is wrong.