public function validateUrl($url, $options = []) {
        try {
            $query = [
                'out'    => 'json',
                'parser' => $this->parser,
                'doc'    => (string) $url,
            ];
            
            if (isset($options['checkErrorPages']) && $options['checkErrorPages'] === true) {
                $query['checkerrorpages'] = true;
            }
            
            $response = $this->httpClient->get('', [
                'query' => $query,
            ]);

            return new Response($response);
        } catch (RequestException $e) {
            throw new ServerException($e->getMessage());
        }
    }
public function validateUrl($url, $options = []) {
        try {
            $query = [
                'out'    => 'json',
                'parser' => $this->parser,
                'doc'    => (string) $url,
            ];
            
            if (isset($options['checkErrorPages']) && $options['checkErrorPages'] === true) {
                $query['checkerrorpages'] = true;
            }
            
            $response = $this->httpClient->get('', [
                'query' => $query,
            ]);

            return new Response($response);
        } catch (RequestException $e) {
            throw new ServerException($e->getMessage());
        }
    }
public function validateUrl ( $ url , $ options = [ ] ) { try { $ query = [ 'out' => 'json' , 'parser' => $ this -> parser , 'doc' => ( string ) $ url , ] ; if ( isset ( $ options [ 'checkErrorPages' ] ) && $ options [ 'checkErrorPages' ] === true ) { $ query [ 'checkerrorpages' ] = true ; } $ response = $ this -> httpClient -> get ( '' , [ 'query' => $ query , ] ) ; return new Response ( $ response ) ; } catch ( RequestException $ e ) { throw new ServerException ( $ e -> getMessage ( ) ) ; } }
Validate a URL

@param string $url The absolute URL to the document
@param array  $options Array of options:
'checkErrorPages' - Set to true if you want to validate pages that
return status codes which is not in the 2xx range

@return HtmlValidator\Response
@throws ServerException
Validate a URL