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)
        ));
    }