private function getUser($username)
    {
        if (!isset($this->users[strtolower($username)])) {
            $ex = new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username));
            $ex->setUsername($username);

            throw $ex;
        }

        return $this->users[strtolower($username)];
    }
private function getUser($username)
    {
        if (!isset($this->users[strtolower($username)])) {
            $ex = new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username));
            $ex->setUsername($username);

            throw $ex;
        }

        return $this->users[strtolower($username)];
    }
private function getUser ( $ username ) { if ( ! isset ( $ this -> users [ strtolower ( $ username ) ] ) ) { $ ex = new UsernameNotFoundException ( sprintf ( 'Username "%s" does not exist.' , $ username ) ) ; $ ex -> setUsername ( $ username ) ; throw $ ex ; } return $ this -> users [ strtolower ( $ username ) ] ; }
Returns the user by given username.

@param string $username The username

@return User

@throws UsernameNotFoundException if user whose given username does not exist
Returns the user by given username .