-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Trigger error for the deprecated methods in LegacyExecutionContext. #12718
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
Lumbendil
commented
Nov 29, 2014
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | yes |
Tests pass? | yes |
Fixed tickets | #12688 |
License | MIT |
Doc PR | none |
@@ -49,6 +49,11 @@ public function __construct(ValidatorInterface $validator, $root, MetadataFactor | |||
$translationDomain | |||
); | |||
|
|||
trigger_error('The LegacyExecutionContext and will be removed.' |
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.
please put messages on single long line
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.
fixed
@@ -49,6 +49,8 @@ public function __construct(ValidatorInterface $validator, $root, MetadataFactor | |||
$translationDomain | |||
); | |||
|
|||
trigger_error('The LegacyExecutionContext and will be removed. You should use the new ExecutionContext, which now handles the functionallity of this 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.
The first sentence doesn't seem to be complete.
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.
fixed.
@@ -49,6 +49,8 @@ public function __construct(ValidatorInterface $validator, $root, MetadataFactor | |||
$translationDomain | |||
); | |||
|
|||
trigger_error('The LegacyExecutionContext has been deprecated and will be removed. You should use the new ExecutionContext, which now handles the functionality of this 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.
deprecation messages should use fully qualified class names (LegacyExecutionContext
is not a class name). You can rely on __CLASS__
to make it easier
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.
This warning is actually wrong, because it would be trigger each time the validator is used in a Symfony project.
Maybe we should not add any warning on this one: it's an internal class that nobody should use but the internal BC layer. |
@nicolas-grekas users could be getting the metadata in order to modify it, so I think a warning should be given, so users move to the new ExecutionContext class. |