Skip to content

Update user_provider.rst #12862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions security/user_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ the ``property`` config key. If you want a bit more control over this - e.g. you
want to find a user by ``email`` *or* ``username``, you can do that by making
your ``UserRepository`` implement the
:class:`Symfony\\Bridge\\Doctrine\\Security\\User\\UserLoaderInterface`. This
interface only requires one method: ``loadUserByUsername($username)``::
interface only requires one method: ``loadUserByUsername(string $username)``::

// src/Repository/UserRepository.php
namespace App\Repository;
Expand All @@ -135,7 +135,7 @@ interface only requires one method: ``loadUserByUsername($username)``::
{
// ...

public function loadUserByUsername($usernameOrEmail)
public function loadUserByUsername(string $usernameOrEmail)
{
return $this->createQuery(
'SELECT u
Expand Down Expand Up @@ -366,7 +366,7 @@ command will generate a nice skeleton to get you started::
*
* @throws UsernameNotFoundException if the user is not found
*/
public function loadUserByUsername($username)
public function loadUserByUsername(string $username)
{
// Load a User object from your data source or throw UsernameNotFoundException.
// The $username argument may not actually be a username:
Expand Down Expand Up @@ -402,7 +402,7 @@ command will generate a nice skeleton to get you started::
/**
* Tells Symfony to use this provider for this User class.
*/
public function supportsClass($class)
public function supportsClass(string $class)
{
return User::class === $class;
}
Expand Down