src/Connection.php
protected function makeReadResource($source)
    {
        if (is_resource($source)) {
            return $source;
        }

        if (is_string($source)) {
            $resource = @fopen($source, 'r');

            if ($resource) {
                return $resource;
            }

            $errorInfo = error_get_last();
            throw new FileException(sprintf(
                'Unable to open the file `%s` for reading%s',
                $source,
                $errorInfo ? ': '.$errorInfo['message'] : ''
            ));
        }

        throw new InvalidArgumentException(sprintf(
            'The given source expected to be a file path of a resource, a %s given',
            is_object($source) ? get_class($source).' instance' : gettype($source)
        ));
    }
protected function makeReadResource($source)
    {
        if (is_resource($source)) {
            return $source;
        }

        if (is_string($source)) {
            $resource = @fopen($source, 'r');

            if ($resource) {
                return $resource;
            }

            $errorInfo = error_get_last();
            throw new FileException(sprintf(
                'Unable to open the file `%s` for reading%s',
                $source,
                $errorInfo ? ': '.$errorInfo['message'] : ''
            ));
        }

        throw new InvalidArgumentException(sprintf(
            'The given source expected to be a file path of a resource, a %s given',
            is_object($source) ? get_class($source).' instance' : gettype($source)
        ));
    }
protected function makeReadResource ( $ source ) { if ( is_resource ( $ source ) ) { return $ source ; } if ( is_string ( $ source ) ) { $ resource = @ fopen ( $ source , 'r' ) ; if ( $ resource ) { return $ resource ; } $ errorInfo = error_get_last ( ) ; throw new FileException ( sprintf ( 'Unable to open the file `%s` for reading%s' , $ source , $ errorInfo ? ': ' . $ errorInfo [ 'message' ] : '' ) ) ; } throw new InvalidArgumentException ( sprintf ( 'The given source expected to be a file path of a resource, a %s given' , is_object ( $ source ) ? get_class ( $ source ) . ' instance' : gettype ( $ source ) ) ) ; }
Makes a resource for reading data.

@param string|resource $source A file path or a read resource
@return resource
@throws FileException
@throws InvalidArgumentException
Makes a resource for reading data .