protected function createWritableStream ($filePath)
    {
        if (is_resource($filePath)) {
            $stream = $filePath;
        } elseif (is_string($filePath)) {
            $stream = fopen($filePath, 'wb');
            if (! $stream) {
                throw new InvalidArgumentException("Can't open file `{$filePath}` for writing.");
            }
        } else {
            $stream = tmpfile();
        }

        return $stream;
    }
protected function createWritableStream ($filePath)
    {
        if (is_resource($filePath)) {
            $stream = $filePath;
        } elseif (is_string($filePath)) {
            $stream = fopen($filePath, 'wb');
            if (! $stream) {
                throw new InvalidArgumentException("Can't open file `{$filePath}` for writing.");
            }
        } else {
            $stream = tmpfile();
        }

        return $stream;
    }
protected function createWritableStream ( $ filePath ) { if ( is_resource ( $ filePath ) ) { $ stream = $ filePath ; } elseif ( is_string ( $ filePath ) ) { $ stream = fopen ( $ filePath , 'wb' ) ; if ( ! $ stream ) { throw new InvalidArgumentException ( "Can't open file `{$filePath}` for writing." ) ; } } else { $ stream = tmpfile ( ) ; } return $ stream ; }
Creates a writable stream that downloaded contents can be stored in.

@param string|null $filePath

@return resource
Creates a writable stream that downloaded contents can be stored in .