src/Repository/User/UserRepository.php
/**
     * Loads the user for the given username.
     *
     * This method must return null if the user is not found.
     *
     * @param string $username The username
     */
Loads the user for the given username.
This method must return null if the user is not found.

@param string $username The username
Loads the user for the given username . This method must return null if the user is not found . @param string $username The username
public function loadUserByUsername($username): ?User
    {
        $user = $this->findOneBy(['username' => $username]);
        if ($user instanceof User) {
            return $user;
        }
        return null;
    }
public function loadUserByUsername ( $ username ) : ? User { $ user = $ this -> findOneBy ( [ 'username' => $ username ] ) ; if ( $ user instanceof User ) { return $ user ; } return null ; }
Loads the user for the given username.
Loads the user for the given username .