Skip to content

Commit bd34c6b

Browse files
committed
Update code example to fit description
The text mentions an $encoder object, which wasn't created.
1 parent 0df1064 commit bd34c6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,8 +1175,8 @@ in the following way from a controller::
11751175
// whatever *your* User object is
11761176
$user = new AppBundle\Entity\User();
11771177
$plainPassword = 'ryanpass';
1178-
$encoded = $this->container->get('security.password_encoder')
1179-
->encodePassword($user, $plainPassword);
1178+
$encoder = $this->container->get('security.password_encoder');
1179+
$encoded = $encoder->encodePassword($user, $plainPassword);
11801180

11811181
$user->setPassword($encoded);
11821182

0 commit comments

Comments
 (0)