@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | if ($this->client->isBucketVersioned(['bucket' => $sourceBucket])) { |
| 54 | 54 | $version = $this->client->getCurrentItemVersion(['bucket' => $sourceBucket, 'key' => $params['source']]); |
| 55 | - $config['CopySource'] = $copySource . '?versionId='.$version; |
|
| 55 | + $config['CopySource'] = $copySource . '?versionId=' . $version; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $copied = $this->client->getConn()->copyObject($config); |
@@ -200,7 +200,7 @@ |
||
| 200 | 200 | $key = $this->client->getEncoder()->decode($key); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - $index = $key.'<VERSION_ID:'.$version.'>'; |
|
| 203 | + $index = $key . '<VERSION_ID:' . $version . '>'; |
|
| 204 | 204 | |
| 205 | 205 | if (null != $hydrate and true === $hydrate) { |
| 206 | 206 | $items[$index] = $this->client->getItem(['bucket' => $bucketName, 'key' => $key, 'version' => $version]); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $bucketName = $params['bucket']; |
| 36 | 36 | |
| 37 | 37 | if (false === S3BucketNameValidator::isValid($bucketName)) { |
| 38 | - throw new InvalidS3NameException(sprintf('%s is not a valid bucket name. ['.implode(', ', S3BucketNameValidator::validate($bucketName)).']', $bucketName)); |
|
| 38 | + throw new InvalidS3NameException(sprintf('%s is not a valid bucket name. [' . implode(', ', S3BucketNameValidator::validate($bucketName)) . ']', $bucketName)); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | if (true === $this->client->hasBucket(['bucket' => $bucketName])) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if (false === S3ObjectSafeNameValidator::isValid($keyName)) { |
| 50 | - throw new InvalidS3NameException(sprintf('%s is not a valid S3 object name. ['.implode(', ', S3ObjectSafeNameValidator::validate($keyName)).']', $keyName)); |
|
| 50 | + throw new InvalidS3NameException(sprintf('%s is not a valid S3 object name. [' . implode(', ', S3ObjectSafeNameValidator::validate($keyName)) . ']', $keyName)); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if ((isset($params['storage']) and false === S3StorageClassNameValidator::isValid($params['storage']))) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | [ |
| 98 | 98 | 'bucket' => $bucketName, |
| 99 | 99 | 'key' => $keyName, |
| 100 | - 'before_initiate' => function (CommandInterface $command) use ($source, $params, $keyName) { |
|
| 100 | + 'before_initiate' => function(CommandInterface $command) use ($source, $params, $keyName) { |
|
| 101 | 101 | if (extension_loaded('fileinfo')) { |
| 102 | 102 | $command['ContentType'] = File::getMimeType($source); |
| 103 | 103 | } |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | $command['Metadata'] = $params['meta']; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $command['Metadata'][ 'original_name'] = File::getBaseName($keyName); |
|
| 114 | - $command['MetadataDirective'] = 'REPLACE'; |
|
| 113 | + $command['Metadata']['original_name'] = File::getBaseName($keyName); |
|
| 114 | + $command['MetadataDirective'] = 'REPLACE'; |
|
| 115 | 115 | } |
| 116 | 116 | ] |
| 117 | 117 | ); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $targetBucket = (isset($params['target_bucket'])) ? $params['target_bucket'] : $params['source_bucket']; |
| 62 | 62 | |
| 63 | 63 | foreach ($params['files']['source'] as $key => $file) { |
| 64 | - $targetKey = (isset($params['files']['target'][$key])) ? $params['files']['target'][$key] : $file; |
|
| 64 | + $targetKey = (isset($params['files']['target'][$key])) ? $params['files']['target'][$key] : $file; |
|
| 65 | 65 | $sourceBucket = $params['source_bucket']; |
| 66 | 66 | |
| 67 | 67 | if ($this->client->hasEncoder()) { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | if ($this->client->isBucketVersioned(['bucket' => $sourceBucket])) { |
| 82 | 82 | $version = $this->client->getCurrentItemVersion(['bucket' => $sourceBucket, 'key' => $params['source']]); |
| 83 | - $config['CopySource'] = $copySource . '?versionId='.$version; |
|
| 83 | + $config['CopySource'] = $copySource . '?versionId=' . $version; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $commands[] = $this->client->getConn()->getCommand('CopyObject', $config); |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | // Create a pool and provide an optional array of configuration |
| 91 | 91 | $pool = new CommandPool($this->client->getConn(), $commands, [ |
| 92 | 92 | 'concurrency' => (isset($params['concurrency'])) ? $params['concurrency'] : 25, |
| 93 | - 'before' => function (CommandInterface $cmd, $iterKey) { |
|
| 93 | + 'before' => function(CommandInterface $cmd, $iterKey) { |
|
| 94 | 94 | if (null !== $this->commandHandlerLogger) { |
| 95 | 95 | $this->commandHandlerLogger->log($this, sprintf('About to send \'%s\'', $iterKey)); |
| 96 | 96 | } |
| 97 | 97 | }, |
| 98 | 98 | // Invoke this function for each successful transfer |
| 99 | - 'fulfilled' => function ( |
|
| 99 | + 'fulfilled' => function( |
|
| 100 | 100 | ResultInterface $result, |
| 101 | 101 | $iterKey, |
| 102 | 102 | PromiseInterface $aggregatePromise |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | }, |
| 112 | 112 | // Invoke this function for each failed transfer |
| 113 | - 'rejected' => function ( |
|
| 113 | + 'rejected' => function( |
|
| 114 | 114 | AwsException $reason, |
| 115 | 115 | $iterKey, |
| 116 | 116 | PromiseInterface $aggregatePromise |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $bucketName = $params['bucket']; |
| 33 | 33 | $keyName = $params['key']; |
| 34 | - $days =(isset($params['days'])) ? $params['days'] : 5; |
|
| 34 | + $days = (isset($params['days'])) ? $params['days'] : 5; |
|
| 35 | 35 | $tier = (isset($params['tier'])) ? $params['tier'] : 'Expedited'; |
| 36 | 36 | |
| 37 | 37 | if ($this->client->hasEncoder()) { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | 47 | if ($tier and !in_array($tier, $allowedTiers)) { |
| 48 | - throw new \InvalidArgumentException(sprintf('%s is not a valid tier value. Allowed values are: ['.implode(',', $allowedTiers).']', $tier)); |
|
| 48 | + throw new \InvalidArgumentException(sprintf('%s is not a valid tier value. Allowed values are: [' . implode(',', $allowedTiers) . ']', $tier)); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | try { |