@@ -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 | ); |
@@ -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 { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $targetBucket = (isset($params['target_bucket'])) ? $params['target_bucket'] : $params['source_bucket']; |
64 | 64 | |
65 | 65 | foreach ($params['files']['source'] as $key => $file) { |
66 | - $targetKey = (isset($params['files']['target'][$key])) ? $params['files']['target'][$key] : $file; |
|
66 | + $targetKey = (isset($params['files']['target'][$key])) ? $params['files']['target'][$key] : $file; |
|
67 | 67 | $sourceBucket = $params['source_bucket']; |
68 | 68 | |
69 | 69 | if ($this->client->hasEncoder()) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | if ($this->client->isBucketVersioned(['bucket' => $sourceBucket])) { |
84 | 84 | $version = $this->client->getCurrentItemVersion(['bucket' => $sourceBucket, 'key' => $params['source']]); |
85 | - $config['CopySource'] = $copySource . '?versionId='.$version; |
|
85 | + $config['CopySource'] = $copySource . '?versionId=' . $version; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | $commands[] = $this->client->getConn()->getCommand('CopyObject', $config); |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | // Create a pool and provide an optional array of configuration |
93 | 93 | $pool = new CommandPool($this->client->getConn(), $commands, [ |
94 | 94 | 'concurrency' => (isset($params['concurrency'])) ? $params['concurrency'] : 25, |
95 | - 'before' => function (CommandInterface $cmd, $iterKey) { |
|
95 | + 'before' => function(CommandInterface $cmd, $iterKey) { |
|
96 | 96 | if (null !== $this->commandHandlerLogger) { |
97 | 97 | $this->commandHandlerLogger->log($this, sprintf('About to send \'%s\'', $iterKey)); |
98 | 98 | } |
99 | 99 | }, |
100 | 100 | // Invoke this function for each successful transfer |
101 | - 'fulfilled' => function ( |
|
101 | + 'fulfilled' => function( |
|
102 | 102 | ResultInterface $result, |
103 | 103 | $iterKey |
104 | 104 | ) use ($targetBucket, $targetKeys) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | }, |
113 | 113 | // Invoke this function for each failed transfer |
114 | - 'rejected' => function ( |
|
114 | + 'rejected' => function( |
|
115 | 115 | AwsException $reason |
116 | 116 | ) use (&$errors) { |
117 | 117 | $errors[] = $reason; |