Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added deprecation log for validate and validateValue on ExecutionContext... #12723

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
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Validator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ CHANGELOG
* added `Util\PropertyPath`
* made the PropertyAccess component an optional dependency
* deprecated `ValidatorBuilder::setPropertyAccessor()`

* deprecated `validate` and `validateValue` on `Validator\Context\ExecutionContext` use `getValidator()` together with `inContext()` instead

2.4.0
-----
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Validator/Context/ExecutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ public function addViolationAt($subPath, $message, array $parameters = array(),
*/
public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false)
{
trigger_error('ExecutionContext::validate() is deprecated since version 2.5 and will be removed in 3.0. Use ExecutionContext::getValidator() together with inContext() instead.', E_USER_DEPRECATED);

throw new BadMethodCallException(
'validate() is not supported anymore as of Symfony 2.5. '.
'Please use getValidator() instead or enable the legacy mode.'
Expand All @@ -332,6 +334,8 @@ public function validate($value, $subPath = '', $groups = null, $traverse = fals
*/
public function validateValue($value, $constraints, $subPath = '', $groups = null)
{
trigger_error('ExecutionContext::validateValue() is deprecated since version 2.5 and will be removed in 3.0. Use ExecutionContext::getValidator() together with inContext() instead.', E_USER_DEPRECATED);

throw new BadMethodCallException(
'validateValue() is not supported anymore as of Symfony 2.5. '.
'Please use getValidator() instead or enable the legacy mode.'
Expand Down