protected function getUserByName(string $username)
    {
        $found_user = null;
        $users      = $this->getWordpressParameter('users');

        foreach ($users as $user) {
            if ($username === $user['username']) {
                $found_user = $user;
                break;
            }
        }

        if ($found_user === null) {
            throw new RuntimeException("[W801] User not found for name \"{$username}\"");
        }

        return $found_user;
    }
protected function getUserByName(string $username)
    {
        $found_user = null;
        $users      = $this->getWordpressParameter('users');

        foreach ($users as $user) {
            if ($username === $user['username']) {
                $found_user = $user;
                break;
            }
        }

        if ($found_user === null) {
            throw new RuntimeException("[W801] User not found for name \"{$username}\"");
        }

        return $found_user;
    }
protected function getUserByName ( string $ username ) { $ found_user = null ; $ users = $ this -> getWordpressParameter ( 'users' ) ; foreach ( $ users as $ user ) { if ( $ username === $ user [ 'username' ] ) { $ found_user = $ user ; break ; } } if ( $ found_user === null ) { throw new RuntimeException ( "[W801] User not found for name \"{$username}\"" ) ; } return $ found_user ; }
Verify a username is valid and get the matching user information.

@param string $username

@throws \RuntimeException

@return array The WordPress user details matching the given username.
Verify a username is valid and get the matching user information .