src/ApiClient.php
public function getUserByName($username)
    {
        return $this->getUsers()->then(function (array $users) use ($username) {
            foreach ($users as $user) {
                if ($user->getUsername() === $username) {
                    return $user;
                }
            }

            throw new UserNotFoundException("The user \"$username\" does not exist.");
        });
    }
public function getUserByName($username)
    {
        return $this->getUsers()->then(function (array $users) use ($username) {
            foreach ($users as $user) {
                if ($user->getUsername() === $username) {
                    return $user;
                }
            }

            throw new UserNotFoundException("The user \"$username\" does not exist.");
        });
    }
public function getUserByName ( $ username ) { return $ this -> getUsers ( ) -> then ( function ( array $ users ) use ( $ username ) { foreach ( $ users as $ user ) { if ( $ user -> getUsername ( ) === $ username ) { return $ user ; } } throw new UserNotFoundException ( "The user \"$username\" does not exist." ) ; } ) ; }
Gets a user by username.

If the user could not be found, the returned promise is rejected with a
`UserNotFoundException` exception.

@return \React\Promise\PromiseInterface A promise for a user object.
Gets a user by username .