public function isResponseClass(string $class): bool {
        $pattern = '`^'.str_ireplace('x', '\d', preg_quote($class, '`')).'$`';
        $result = preg_match($pattern, $this->statusCode);

        return $result === 1;
    }
public function isResponseClass(string $class): bool {
        $pattern = '`^'.str_ireplace('x', '\d', preg_quote($class, '`')).'$`';
        $result = preg_match($pattern, $this->statusCode);

        return $result === 1;
    }
public function isResponseClass ( string $ class ) : bool { $ pattern = '`^' . str_ireplace ( 'x' , '\d' , preg_quote ( $ class , '`' ) ) . '$`' ; $ result = preg_match ( $ pattern , $ this -> statusCode ) ; return $ result === 1 ; }
Check if the provided response matches the provided response type.

The {@link $class} is a string representation of the HTTP status code, with 'x' used as a wildcard.

Class '2xx' = All 200-level responses
Class '30x' = All 300-level responses up to 309

@param string $class A string representation of the HTTP status code, with 'x' used as a wildcard.
@return boolean Returns `true` if the response code matches the {@link $class}, `false` otherwise.
Check if the provided response matches the provided response type .