From c7b1a6abaa3f3c62d9b66d58a95ad5043d84a2f2 Mon Sep 17 00:00:00 2001 From: Samuele Lilli Date: Tue, 27 Jun 2017 16:30:29 +0200 Subject: [PATCH] Update custom_constraint.rst Updated custom_constraint.rst with Validator::class syntax --- 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 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``),