Skip to content

Commit

Permalink
minor symfony#10110 Undefined variable $userName in example (Trekels)
Browse files Browse the repository at this point in the history
This PR was submitted for the 4.1 branch but it was merged into the 2.8 branch instead (closes symfony#10110).

Discussion
----------

Undefined variable $userName in example

The $username variable in the `WebServiceUserProvider` example is not set, since the user object must implement the `UserInterface` (according to best practice) we can set the variable by calling `$user->getUsername()`.

Commits
-------

e6d500f Undefined variable $userName in example
  • Loading branch information
javiereguiluz committed Jul 23, 2018
2 parents 24816e5 + e6d500f commit 2fdc86d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions security/custom_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Here's an example of how this might look::
);
}

$username = $user->getUsername();

return $this->fetchUser($username);
}

Expand Down

0 comments on commit 2fdc86d

Please sign in to comment.