From bd34c6b77ddba8c4a5dec20f511d7402ada51aea Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Sat, 3 Jan 2015 09:01:30 +0100 Subject: [PATCH] Update code example to fit description The text mentions an $encoder object, which wasn't created. --- book/security.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/security.rst b/book/security.rst index 6942b426965..49e9be8622b 100644 --- a/book/security.rst +++ b/book/security.rst @@ -1175,8 +1175,8 @@ in the following way from a controller:: // whatever *your* User object is $user = new AppBundle\Entity\User(); $plainPassword = 'ryanpass'; - $encoded = $this->container->get('security.password_encoder') - ->encodePassword($user, $plainPassword); + $encoder = $this->container->get('security.password_encoder'); + $encoded = $encoder->encodePassword($user, $plainPassword); $user->setPassword($encoded);