VCR\Util\StreamProcessor::url_stat PHP Method

url_stat() public method

Retrieve information about a file.
public url_stat ( string $path, integer $flags ) : integer
$path string The file path or URL to stat.
$flags integer Holds additional flags set by the streams API.
return integer Should return as many elements as stat() does.
    public function url_stat($path, $flags)
    {
        $this->restore();
        if ($flags & STREAM_URL_STAT_QUIET) {
            set_error_handler(function () {
                // Use native error handler
                return false;
            });
            $result = @stat($path);
            restore_error_handler();
        } else {
            $result = stat($path);
        }
        $this->intercept();
        return $result;
    }