Skip to content

Commit

Permalink
bug #3570 Callback: [Validator, validate] expects validate to be stat…
Browse files Browse the repository at this point in the history
…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 5c4336a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reference/constraints/Callback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
// ...
}
Expand Down

0 comments on commit 5c4336a

Please sign in to comment.