Skip to content

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

Closed

Conversation

Lumbendil
Copy link

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.'
Copy link
Member

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

Copy link
Author

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);
Copy link
Member

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.

Copy link
Author

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);
Copy link
Member

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

Copy link
Member

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.

@nicolas-grekas
Copy link
Member

Maybe we should not add any warning on this one: it's an internal class that nobody should use but the internal BC layer.

@Lumbendil
Copy link
Author

@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.

@stof
Copy link
Member

stof commented Jan 3, 2015

One of these deprecation warning is wrong, and the other one is also added in #13219 (I forgot this older PR not updated), so I'm closing this one in favor of #13219

@stof stof closed this Jan 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants