Storage/src/StorageObject.php
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'],
            'userProject' => $this->identity['userProject'],
        ]) + $this->formatEncryptionHeaders($options + $this->encryptionData);
    }
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'],
            'userProject' => $this->identity['userProject'],
        ]) + $this->formatEncryptionHeaders($options + $this->encryptionData);
    }
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' ] , 'userProject' => $ this -> identity [ 'userProject' ] , ] ) + $ this -> formatEncryptionHeaders ( $ options + $ this -> encryptionData ) ; }
Formats a destination based request, such as copy or rewrite.

@param string|Bucket $destination The destination bucket.
@param array $options Options to configure.
@return array
Formats a destination based request such as copy or rewrite .