-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Move deprecation under use statements #25014
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
Conversation
greg0ire
commented
Nov 18, 2017
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | none |
License | MIT |
Doc PR | n/a |
It references one of them, and produces a wrong error message.
5aeaa32
to
579149b
Compare
Don't merge yet there are many more occurences. |
Files I need to check:
found with |
It's ready now |
@@ -11,7 +11,7 @@ | |||
|
|||
namespace Symfony\Bundle\SecurityBundle\Command; | |||
|
|||
@trigger_error(sprintf('Class "%s" is deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\Command\SetAclCommand instead.', SetAclCommand::class), E_USER_DEPRECATED); | |||
@trigger_error(sprintf('Class "%s" is deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\Command\SetAclCommand instead.', InitAclCommand::class), E_USER_DEPRECATED); |
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.
I'd move this below the use
statements and use ::class
for both classes.
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.
Wait my fix was incomplete it seems.
Travis build failures seem unrelated. |
447723b
to
b17e085
Compare
b17e085
to
2ba3701
Compare
Actually I think the convention has always been reverse: the deprecation should be just below the namespace. That's what we did in 2.7 & 2.8, and if you grep with a more generic regexp, you'll see that most of the existing notices are at the top. |
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.
should really be at the very top of the file, just below the namespace
@nicolas-grekas but then the use statements can't be used, see https://3v4l.org/8PjTg . I see 2 solutions:
|
Oh, got it! So this is a real bug fix. Let's merge as is then, no need to change everything now (and maybe discuss the general change somewhere else.) |
Thank you @greg0ire. |
This PR was squashed before being merged into the 3.4 branch (closes #25014). Discussion ---------- Move deprecation under use statements | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | n/a Commits ------- 0a5b016 Move deprecation under use statements
@@ -22,6 +20,8 @@ | |||
use Doctrine\DBAL\Connection; | |||
use Doctrine\DBAL\Schema\SchemaException; | |||
|
|||
@trigger_error(sprintf('Class "%s" is deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\Command\InitAclCommand instead.', InitAclCommand::class), E_USER_DEPRECATED); | |||
|
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.
Change is not needed
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.
Race condition :) not a big deal
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.
right, let me fix it
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.
Don't worry, it's merged already
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.
done