diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index d2e7e148266..eebfd087fb0 100644 --- a/validation/custom_constraint.rst +++ b/validation/custom_constraint.rst @@ -45,7 +45,7 @@ has this default logic:: // in the base Symfony\Component\Validator\Constraint class public function validatedBy() { - return \get_class($this).'Validator'; + return static::class.'Validator'; } In other words, if you create a custom ``Constraint`` (e.g. ``MyConstraint``),