protected function getReader($URI, $request)
    {
        if (!is_string($URI)) {
            throw new \InvalidArgumentException('Not a string');
        }

        if (!is_bool($request)) {
            throw new \InvalidArgumentException('Not a boolean');
        }

        $this->currentNode = null;
        $reader = new \XMLReader();
        $reader->open($URI, null, LIBXML_NONET | LIBXML_NOENT);
        if ($this->validate) {
            $schema = dirname(__DIR__) .
                DIRECTORY_SEPARATOR . 'data' .
                DIRECTORY_SEPARATOR;
            $schema .= $request ? 'request.rng' : 'response.rng';
            $reader->setRelaxNGSchema($schema);
        }
        return $reader;
    }
protected function getReader($URI, $request)
    {
        if (!is_string($URI)) {
            throw new \InvalidArgumentException('Not a string');
        }

        if (!is_bool($request)) {
            throw new \InvalidArgumentException('Not a boolean');
        }

        $this->currentNode = null;
        $reader = new \XMLReader();
        $reader->open($URI, null, LIBXML_NONET | LIBXML_NOENT);
        if ($this->validate) {
            $schema = dirname(__DIR__) .
                DIRECTORY_SEPARATOR . 'data' .
                DIRECTORY_SEPARATOR;
            $schema .= $request ? 'request.rng' : 'response.rng';
            $reader->setRelaxNGSchema($schema);
        }
        return $reader;
    }
protected function getReader ( $ URI , $ request ) { if ( ! is_string ( $ URI ) ) { throw new \ InvalidArgumentException ( 'Not a string' ) ; } if ( ! is_bool ( $ request ) ) { throw new \ InvalidArgumentException ( 'Not a boolean' ) ; } $ this -> currentNode = null ; $ reader = new \ XMLReader ( ) ; $ reader -> open ( $ URI , null , LIBXML_NONET | LIBXML_NOENT ) ; if ( $ this -> validate ) { $ schema = dirname ( __DIR__ ) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR ; $ schema .= $ request ? 'request.rng' : 'response.rng' ; $ reader -> setRelaxNGSchema ( $ schema ) ; } return $ reader ; }
Returns an XML reader for some data.

\param string $URI
URI to the XML data to process.

\param bool $request
Whether the data refers to an XML-RPC
request (\c true) or a response (\c false).

\retval XMLReader
An XML reader for the given data.

\throw InvalidArgumentException
You tried to pass something that is not
a boolean as the \c $request parameter.

\note
The reader is set to validate the document
on the fly if that's what this decoder was
configured to do during construction.
Returns an XML reader for some data .