Skip to content

Commit 027bc97

Browse files
committed
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 ```
1 parent dce2e23 commit 027bc97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reference/constraints/Callback.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ your validation function is ``Vendor\Package\Validator::validate()``::
160160

161161
class Validator
162162
{
163-
public function validate($object, ExecutionContextInterface $context)
163+
public static function validate($object, ExecutionContextInterface $context)
164164
{
165165
// ...
166166
}

0 commit comments

Comments
 (0)