diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index e456a6b7c5a..3ae4d1f855a 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 \get_class($this).'Validator'; } In other words, if you create a custom ``Constraint`` (e.g. ``MyConstraint``),