Skip to content
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

Merged

Conversation

@fancyweb
Copy link
Contributor

fancyweb commented Jan 8, 2020

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.

@@ -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);

This comment has been minimized.

Copy link
@fancyweb

fancyweb Jan 8, 2020

Author Contributor

Alternative: $triggerDeprecation = $deprecatedPath; and then use $triggerDeprecation later but that seemed less readable.

@nicolas-grekas nicolas-grekas added this to the 4.4 milestone Jan 8, 2020
@yceruto
yceruto approved these changes Jan 8, 2020
@@ -75,13 +75,13 @@ public function locate($file, $currentPath = null, $first = true)
}

This comment has been minimized.

Copy link
@yceruto

yceruto Jan 8, 2020

Member

shouldn't it be a continue statement instead of return $locations?

This comment has been minimized.

Copy link
@fancyweb

fancyweb Jan 9, 2020

Author Contributor

see #34886 (comment) for the explanation I guess.

@nicolas-grekas

This comment has been minimized.

Copy link
Member

nicolas-grekas commented Jan 9, 2020

Thank you @fancyweb.

nicolas-grekas added a commit that referenced this pull request Jan 9, 2020
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
@nicolas-grekas nicolas-grekas merged commit 18ce839 into symfony:4.4 Jan 9, 2020
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
@fancyweb fancyweb deleted the fancyweb:http-kernel-fix-file-locator-deprec branch Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.