Completed
Push — master ( f23ef9...5b38e1 )
by Edd
01:20
created
src/Signature.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -163,24 +163,24 @@  discard block
 block discarded – undo
163 163
 
164 164
         $separator = (substr($url, -1) === "/" ? "" : "/");
165 165
 
166
-        return $url . $separator . urlencode($this->bucket);
166
+        return $url.$separator.urlencode($this->bucket);
167 167
     }
168 168
 
169 169
     private function buildAmazonUrl()
170 170
     {
171
-        $region = (string)$this->region;
171
+        $region = (string) $this->region;
172 172
 
173 173
         // Only the us-east-1 region is exempt from needing the region in the url.
174 174
         if ($region !== "us-east-1") {
175
-            $middle = "-" . $region;
175
+            $middle = "-".$region;
176 176
         } else {
177 177
             $middle = "";
178 178
         }
179 179
 
180
-        if($this->options['accelerate'])
181
-            return "//" . urlencode($this->bucket) . "." . self::SERVICE . "-accelerate.amazonaws.com";
180
+        if ($this->options['accelerate'])
181
+            return "//".urlencode($this->bucket).".".self::SERVICE."-accelerate.amazonaws.com";
182 182
         else
183
-            return "//" . self::SERVICE . $middle . ".amazonaws.com" . "/" . urlencode($this->bucket);
183
+            return "//".self::SERVICE.$middle.".amazonaws.com"."/".urlencode($this->bucket);
184 184
     }
185 185
 
186 186
     /**
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $this->options['acl'] = new Acl($this->options['acl']);
207 207
 
208 208
         // Return HTTP code must be a string
209
-        $this->options['success_status'] = (string)$this->options['success_status'];
209
+        $this->options['success_status'] = (string) $this->options['success_status'];
210 210
 
211 211
         // Encryption option is just a helper to set this header, but we need to set it early on so it
212 212
         // affects both the policy and the inputs generated.
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
         $inputs = [
246 246
             'Content-Type' => $this->options['content_type'],
247
-            'acl' => (string)$this->options['acl'],
247
+            'acl' => (string) $this->options['acl'],
248 248
             'success_action_status' => $this->options['success_status'],
249 249
             'policy' => $this->base64Policy,
250 250
             'X-amz-credential' => $this->credentials,
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         if ($addKey) {
259 259
             // Note: The Key (filename) will need to be populated with JS on upload
260 260
             // if anything other than the filename is wanted.
261
-            $inputs['key'] = $this->options['valid_prefix'] . $this->options['default_filename'];
261
+            $inputs['key'] = $this->options['valid_prefix'].$this->options['default_filename'];
262 262
         }
263 263
 
264 264
         return $inputs;
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     {
276 276
         $inputs = [];
277 277
         foreach ($this->getFormInputs($addKey) as $name => $value) {
278
-            $inputs[] = '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
278
+            $inputs[] = '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
279 279
         }
280 280
         return implode(PHP_EOL, $inputs);
281 281
     }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             'expiration' => $this->getExpirationDate(),
308 308
             'conditions' => [
309 309
                 ['bucket' => $this->bucket],
310
-                ['acl' => (string)$this->options['acl']],
310
+                ['acl' => (string) $this->options['acl']],
311 311
                 ['starts-with', '$key', $this->options['valid_prefix']],
312 312
                 $this->getPolicyContentTypeArray(),
313 313
                 ['content-length-range', 0, $this->mbToBytes($this->options['max_file_size'])],
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
     private function addAdditionalInputs($policy)
335 335
     {
336 336
         foreach ($this->options['additional_inputs'] as $name => $value) {
337
-            $policy['conditions'][] = ['starts-with', '$' . $name, $value];
337
+            $policy['conditions'][] = ['starts-with', '$'.$name, $value];
338 338
         }
339 339
         return $policy;
340 340
     }
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
     {
347 347
         $signatureData = [
348 348
             $this->getShortDateFormat(),
349
-            (string)$this->region,
349
+            (string) $this->region,
350 350
             self::SERVICE,
351 351
             self::REQUEST_TYPE
352 352
         ];
353 353
 
354 354
         // Iterates over the data (defined in the array above), hashing it each time.
355
-        $initial = 'AWS4' . $this->secret;
355
+        $initial = 'AWS4'.$this->secret;
356 356
         $signingKey = array_reduce($signatureData, function($key, $data) {
357 357
             return $this->keyHash($data, $key);
358 358
         }, $initial);
Please login to merge, or discard this patch.