Permalink
Browse files

bug #3570 Callback: [Validator, validate] expects validate to be stat…

…ic (nixilla)

This PR was merged into the 2.4 branch.

Discussion
----------

Callback: [Validator, validate] expects validate to be static

Otherwise you'll get:
```
ContextErrorException: Runtime Notice: call_user_func() expects parameter 1 to be a valid callback, non-static method Vendor\Package\Validator::validate() should not be called statically in Symfony/Component/Validator/Constraints/CallbackValidator.php
```

Commits
-------

027bc97 Callback: [Validator, validate] expects validate to be static
  • Loading branch information...
weaverryan committed Feb 27, 2014
2 parents 77628d0 + 027bc97 commit 5c4336a325ec98bc0eb7ef35baf86bcb9628e490
Showing with 1 addition and 1 deletion.
  1. +1 −1 reference/constraints/Callback.rst
@@ -160,7 +160,7 @@ your validation function is ``Vendor\Package\Validator::validate()``::
class Validator
{
public function validate($object, ExecutionContextInterface $context)
public static function validate($object, ExecutionContextInterface $context)
{
// ...
}

0 comments on commit 5c4336a

Please sign in to comment.