Completed
Push — master ( 32fb60...19b841 )
by Edd
01:50
created
src/Signature.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -159,21 +159,21 @@  discard block
 block discarded – undo
159 159
 
160 160
         $separator = (substr($url, -1) === "/" ? "" : "/");
161 161
 
162
-        return $url . $separator . urlencode($this->bucket);
162
+        return $url.$separator.urlencode($this->bucket);
163 163
     }
164 164
 
165 165
     private function buildAmazonUrl()
166 166
     {
167
-        $region = (string)$this->region;
167
+        $region = (string) $this->region;
168 168
 
169 169
         // Only the us-east-1 region is exempt from needing the region in the url.
170 170
         if ($region !== "us-east-1") {
171
-            $middle = "-" . $region;
171
+            $middle = "-".$region;
172 172
         } else {
173 173
             $middle = "";
174 174
         }
175 175
 
176
-        return "//" . self::SERVICE . $middle . ".amazonaws.com" . "/" . urlencode($this->bucket);
176
+        return "//".self::SERVICE.$middle.".amazonaws.com"."/".urlencode($this->bucket);
177 177
     }
178 178
 
179 179
     /**
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $this->options['acl'] = new Acl($this->options['acl']);
200 200
 
201 201
         // Return HTTP code must be a string
202
-        $this->options['success_status'] = (string)$this->options['success_status'];
202
+        $this->options['success_status'] = (string) $this->options['success_status'];
203 203
     }
204 204
 
205 205
     /**
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
         $inputs = [
233 233
             'Content-Type' => $this->options['content_type'],
234
-            'acl' => (string)$this->options['acl'],
234
+            'acl' => (string) $this->options['acl'],
235 235
             'success_action_status' => $this->options['success_status'],
236 236
             'policy' => $this->base64Policy,
237 237
             'X-amz-credential' => $this->credentials,
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         if ($addKey) {
250 250
             // Note: The Key (filename) will need to be populated with JS on upload
251 251
             // if anything other than the filename is wanted.
252
-            $inputs['key'] = $this->options['valid_prefix'] . $this->options['default_filename'];
252
+            $inputs['key'] = $this->options['valid_prefix'].$this->options['default_filename'];
253 253
         }
254 254
 
255 255
         return $inputs;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     {
267 267
         $inputs = [];
268 268
         foreach ($this->getFormInputs($addKey) as $name => $value) {
269
-            $inputs[] = '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
269
+            $inputs[] = '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
270 270
         }
271 271
         return implode(PHP_EOL, $inputs);
272 272
     }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
             'expiration' => $this->getExpirationDate(),
299 299
             'conditions' => [
300 300
                 ['bucket' => $this->bucket],
301
-                ['acl' => (string)$this->options['acl']],
301
+                ['acl' => (string) $this->options['acl']],
302 302
                 ['starts-with', '$key', $this->options['valid_prefix']],
303 303
                 $this->getPolicyContentTypeArray(),
304 304
                 ['content-length-range', 0, $this->mbToBytes($this->options['max_file_size'])],
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
     private function addAdditionalInputs($policy)
326 326
     {
327 327
         foreach ($this->options['additional_inputs'] as $name => $value) {
328
-            $policy['conditions'][] = ['starts-with', '$' . $name, $value];
328
+            $policy['conditions'][] = ['starts-with', '$'.$name, $value];
329 329
         }
330 330
         return $policy;
331 331
     }
@@ -337,13 +337,13 @@  discard block
 block discarded – undo
337 337
     {
338 338
         $signatureData = [
339 339
             $this->getShortDateFormat(),
340
-            (string)$this->region,
340
+            (string) $this->region,
341 341
             self::SERVICE,
342 342
             self::REQUEST_TYPE
343 343
         ];
344 344
 
345 345
         // Iterates over the data (defined in the array above), hashing it each time.
346
-        $initial = 'AWS4' . $this->secret;
346
+        $initial = 'AWS4'.$this->secret;
347 347
         $signingKey = array_reduce($signatureData, function($key, $data) {
348 348
             return $this->keyHash($data, $key);
349 349
         }, $initial);
Please login to merge, or discard this patch.