-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[3.0] [Validator] deprecations cleanup #15708
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
TomasVotruba
wants to merge
10
commits into
symfony:master
from
TomasVotruba:validation-deprecations
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
df22026
merge
TomasVotruba 89314c8
[3.0] validator deprecations cleanup
TomasVotruba fc257bc
[3.0] validator deprecations cleanup [part 2]
TomasVotruba b5f40a7
[3.0] validator deprecations cleanup - form
TomasVotruba c2b495b
cs
TomasVotruba 630346a
[3.0] validator deprecations cleanup - form, validation listener
TomasVotruba b594d26
[3.0] validator deprecations cleanup - cleanup commented code
TomasVotruba 9dcaeb0
return commented code
TomasVotruba 4f1b8c9
[3.0] validator deprecations cleanup - cleanup legacy code
TomasVotruba c8aabb5
cs fix
TomasVotruba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,7 @@ | |
|
||
namespace Symfony\Component\Validator; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the empty line between the namespace and use statements must be kept |
||
use Symfony\Component\Validator\Context\ExecutionContextInterface as ExecutionContextInterface2Dot5; | ||
use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; | ||
use Symfony\Component\Validator\Violation\LegacyConstraintViolationBuilder; | ||
use Symfony\Component\Validator\Context\ExecutionContextInterface; | ||
|
||
/** | ||
* Base class for constraint validators. | ||
|
@@ -52,51 +50,6 @@ public function initialize(ExecutionContextInterface $context) | |
$this->context = $context; | ||
} | ||
|
||
/** | ||
* Wrapper for {@link ExecutionContextInterface::buildViolation} that | ||
* supports the 2.4 context API. | ||
* | ||
* @param string $message The violation message | ||
* @param array $parameters The message parameters | ||
* | ||
* @return ConstraintViolationBuilderInterface The violation builder | ||
* | ||
* @deprecated since version 2.5, to be removed in 3.0. | ||
*/ | ||
protected function buildViolation($message, array $parameters = array()) | ||
{ | ||
@trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); | ||
|
||
if ($this->context instanceof ExecutionContextInterface2Dot5) { | ||
return $this->context->buildViolation($message, $parameters); | ||
} | ||
|
||
return new LegacyConstraintViolationBuilder($this->context, $message, $parameters); | ||
} | ||
|
||
/** | ||
* Wrapper for {@link ExecutionContextInterface::buildViolation} that | ||
* supports the 2.4 context API. | ||
* | ||
* @param ExecutionContextInterface $context The context to use | ||
* @param string $message The violation message | ||
* @param array $parameters The message parameters | ||
* | ||
* @return ConstraintViolationBuilderInterface The violation builder | ||
* | ||
* @deprecated since version 2.5, to be removed in 3.0. | ||
*/ | ||
protected function buildViolationInContext(ExecutionContextInterface $context, $message, array $parameters = array()) | ||
{ | ||
@trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); | ||
|
||
if ($context instanceof ExecutionContextInterface2Dot5) { | ||
return $context->buildViolation($message, $parameters); | ||
} | ||
|
||
return new LegacyConstraintViolationBuilder($context, $message, $parameters); | ||
} | ||
|
||
/** | ||
* Returns a string representation of the type of the value. | ||
* | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
we are missing a deprecation warning here btw
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.
What needs to be done?
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.
a PR should be opened to add the deprecation warning in the 2.7 branch