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