From b900abfa6cbf9f1efd443f93ca007cb3800d287a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20MARTIN?= Date: Thu, 28 Sep 2017 17:03:13 +0200 Subject: [PATCH] Fix explanation when Creating a Validator In the base class Symfony\Component\Validator\Constraint, the method validatedBy() contain this code instead. This makes the explanation understandable. --- validation/custom_constraint.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index 7cee2f722a2..1416de4c326 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 ContainsAlphanumericValidator::class; + return get_class($this).'Validator'; } In other words, if you create a custom ``Constraint`` (e.g. ``MyConstraint``),