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

Skip to content

Commit 445fabd

Browse files
committed
minor symfony#12723 Added deprecation log for validate and validateValue on ExecutionContext... (Lenard Palko)
This PR was squashed before being merged into the 2.7 branch (closes symfony#12723). Discussion ---------- Added deprecation log for validate and validateValue on ExecutionContext... | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | symfony#12685 | License | MIT | Doc PR | Commits ------- deeb652 Added deprecation log for validate and validateValue on ExecutionContext...
2 parents 590b4f3 + deeb652 commit 445fabd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ CHANGELOG
7474
* added `Util\PropertyPath`
7575
* made the PropertyAccess component an optional dependency
7676
* deprecated `ValidatorBuilder::setPropertyAccessor()`
77-
77+
* deprecated `validate` and `validateValue` on `Validator\Context\ExecutionContext` use `getValidator()` together with `inContext()` instead
7878

7979
2.4.0
8080
-----

src/Symfony/Component/Validator/Context/ExecutionContext.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ public function addViolationAt($subPath, $message, array $parameters = array(),
321321
*/
322322
public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false)
323323
{
324+
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);
325+
324326
throw new BadMethodCallException(
325327
'validate() is not supported anymore as of Symfony 2.5. '.
326328
'Please use getValidator() instead or enable the legacy mode.'
@@ -332,6 +334,8 @@ public function validate($value, $subPath = '', $groups = null, $traverse = fals
332334
*/
333335
public function validateValue($value, $constraints, $subPath = '', $groups = null)
334336
{
337+
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);
338+
335339
throw new BadMethodCallException(
336340
'validateValue() is not supported anymore as of Symfony 2.5. '.
337341
'Please use getValidator() instead or enable the legacy mode.'

0 commit comments

Comments
 (0)