From d1b4f9c7dd0f8533905bd77a055862cbcbbecfab Mon Sep 17 00:00:00 2001 From: Giancarlos Salas Date: Tue, 26 Dec 2017 18:04:54 -0500 Subject: [PATCH] use ValidatorInterface --- validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/validation.rst b/validation.rst index 691d71a3e2e..623efbc1550 100644 --- a/validation.rst +++ b/validation.rst @@ -129,16 +129,16 @@ returned. Take this simple example from inside a controller:: // ... use Symfony\Component\HttpFoundation\Response; + use Symfony\Component\Validator\Validator\ValidatorInterface; use App\Entity\Author; // ... - public function author() + public function author(ValidatorInterface $validator) { $author = new Author(); // ... do something to the $author object - $validator = $this->get('validator'); $errors = $validator->validate($author); if (count($errors) > 0) {