Completed
Push — master ( 94d0f1...b56c2c )
by Edd
01:43
created
src/Signature.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function getFormUrl()
120 120
     {
121
-        $region = (string)$this->region;
121
+        $region = (string) $this->region;
122 122
 
123 123
         // Only the us-east-1 region is exempt from needing the region in the url.
124 124
         if ($region !== "us-east-1") {
125
-            $middle = "-" . $region;
125
+            $middle = "-".$region;
126 126
         } else {
127 127
             $middle = "";
128 128
         }
129 129
 
130
-        return "//" . urlencode($this->bucket) . "." . self::SERVICE . $middle . ".amazonaws.com";
130
+        return "//".urlencode($this->bucket).".".self::SERVICE.$middle.".amazonaws.com";
131 131
     }
132 132
 
133 133
     /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $this->options['acl'] = new Acl($this->options['acl']);
152 152
 
153 153
         // Return HTTP code must be a string
154
-        $this->options['success_status'] = (string)$this->options['success_status'];
154
+        $this->options['success_status'] = (string) $this->options['success_status'];
155 155
     }
156 156
 
157 157
     /**
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
         $inputs = [
185 185
             'Content-Type' => $this->options['content_type'],
186
-            'acl' => (string)$this->options['acl'],
186
+            'acl' => (string) $this->options['acl'],
187 187
             'success_action_status' => $this->options['success_status'],
188 188
             'policy' => $this->base64Policy,
189 189
             'X-amz-credential' => $this->credentials,
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         if ($addKey) {
198 198
             // Note: The Key (filename) will need to be populated with JS on upload
199 199
             // if anything other than the filename is wanted.
200
-            $inputs['key'] = $this->options['valid_prefix'] . $this->options['default_filename'];
200
+            $inputs['key'] = $this->options['valid_prefix'].$this->options['default_filename'];
201 201
         }
202 202
 
203 203
         return $inputs;
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     {
215 215
         $inputs = [];
216 216
         foreach ($this->getFormInputs($addKey) as $name => $value) {
217
-            $inputs[] = '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
217
+            $inputs[] = '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
218 218
         }
219 219
         return implode(PHP_EOL, $inputs);
220 220
     }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
             'expiration' => $this->getExpirationDate(),
247 247
             'conditions' => [
248 248
                 ['bucket' => $this->bucket],
249
-                ['acl' => (string)$this->options['acl']],
249
+                ['acl' => (string) $this->options['acl']],
250 250
                 ['starts-with', '$key', $this->options['valid_prefix']],
251 251
                 $this->getPolicyContentTypeArray(),
252 252
                 ['content-length-range', 0, $this->mbToBytes($this->options['max_file_size'])],
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     private function addAdditionalInputs($policy)
274 274
     {
275 275
         foreach ($this->options['additional_inputs'] as $name => $value) {
276
-            $policy['conditions'][] = ['starts-with', '$' . $name, $value];
276
+            $policy['conditions'][] = ['starts-with', '$'.$name, $value];
277 277
         }
278 278
         return $policy;
279 279
     }
@@ -285,13 +285,13 @@  discard block
 block discarded – undo
285 285
     {
286 286
         $signatureData = [
287 287
             $this->getShortDateFormat(),
288
-            (string)$this->region,
288
+            (string) $this->region,
289 289
             self::SERVICE,
290 290
             self::REQUEST_TYPE
291 291
         ];
292 292
 
293 293
         // Iterates over the data (defined in the array above), hashing it each time.
294
-        $initial = 'AWS4' . $this->secret;
294
+        $initial = 'AWS4'.$this->secret;
295 295
         $signingKey = array_reduce($signatureData, function($key, $data) {
296 296
             return $this->keyHash($data, $key);
297 297
         }, $initial);
Please login to merge, or discard this patch.