Google\Cloud\Storage\StorageObject::formatDestinationRequest PHP Method

formatDestinationRequest() private method

Formats a destination based request, such as copy or rewrite.
private formatDestinationRequest ( string | Bucket $destination, array $options ) : array
$destination string | Bucket The destination bucket.
$options array Options to configure.
return array
    private function formatDestinationRequest($destination, array $options)
    {
        if (!is_string($destination) && !$destination instanceof Bucket) {
            throw new \InvalidArgumentException('$destination must be either a string or an instance of Bucket.');
        }
        $destAcl = isset($options['predefinedAcl']) ? $options['predefinedAcl'] : null;
        $destObject = isset($options['name']) ? $options['name'] : $this->identity['object'];
        unset($options['name']);
        unset($options['predefinedAcl']);
        return array_filter(['destinationBucket' => $destination instanceof Bucket ? $destination->name() : $destination, 'destinationObject' => $destObject, 'destinationPredefinedAcl' => $destAcl, 'sourceBucket' => $this->identity['bucket'], 'sourceObject' => $this->identity['object'], 'sourceGeneration' => $this->identity['generation']]) + $this->formatEncryptionHeaders($options + $this->encryptionData);
    }