src/Parser.php
protected function openStream($input)
    {
        if (is_resource($input)) {
            return $input;
        }

        if (!is_file($input)) {
            throw new \Exception('File does not exist: ' . $input);
        }

        $stream = $this->gzipSupported ? @gzopen($input, 'r') : @fopen($input, 'r');
        if (false === $stream) {
            throw new \Exception('Unable to open file for read: ' . $input);
        }

        return $stream;
    }
protected function openStream($input)
    {
        if (is_resource($input)) {
            return $input;
        }

        if (!is_file($input)) {
            throw new \Exception('File does not exist: ' . $input);
        }

        $stream = $this->gzipSupported ? @gzopen($input, 'r') : @fopen($input, 'r');
        if (false === $stream) {
            throw new \Exception('Unable to open file for read: ' . $input);
        }

        return $stream;
    }
protected function openStream ( $ input ) { if ( is_resource ( $ input ) ) { return $ input ; } if ( ! is_file ( $ input ) ) { throw new \ Exception ( 'File does not exist: ' . $ input ) ; } $ stream = $ this -> gzipSupported ? @ gzopen ( $ input , 'r' ) : @ fopen ( $ input , 'r' ) ; if ( false === $ stream ) { throw new \ Exception ( 'Unable to open file for read: ' . $ input ) ; } return $ stream ; }
@param string|resource $input File path or resource

@return resource
@throws \Exception
@param string|resource $input File path or resource