Completed
Pull Request — master (#13)
by
unknown
02:58
created
src/Signature.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -137,20 +137,20 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function getFormUrl()
139 139
     {
140
-        $server = (string)$this->server;
140
+        $server = (string) $this->server;
141 141
         if ($server == "amazon") {
142
-            $region = (string)$this->region;
142
+            $region = (string) $this->region;
143 143
 
144 144
             // Only the us-east-1 region is exempt from needing the region in the url.
145 145
             if ($region !== "us-east-1") {
146
-                $middle = "-" . $region;
146
+                $middle = "-".$region;
147 147
             } else {
148 148
                 $middle = "";
149 149
             }
150 150
 
151
-            return "//" . self::SERVICE . $middle . ".amazonaws.com" . "/" . urlencode($this->bucket);
152
-        }else{
153
-            return "//" . $server . "/" . urlencode($this->bucket);
151
+            return "//".self::SERVICE.$middle.".amazonaws.com"."/".urlencode($this->bucket);
152
+        } else {
153
+            return "//".$server."/".urlencode($this->bucket);
154 154
         }
155 155
     }
156 156
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $this->options['acl'] = new Acl($this->options['acl']);
178 178
 
179 179
         // Return HTTP code must be a string
180
-        $this->options['success_status'] = (string)$this->options['success_status'];
180
+        $this->options['success_status'] = (string) $this->options['success_status'];
181 181
     }
182 182
 
183 183
     /**
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
         $inputs = [
211 211
             'Content-Type' => $this->options['content_type'],
212
-            'acl' => (string)$this->options['acl'],
212
+            'acl' => (string) $this->options['acl'],
213 213
             'success_action_status' => $this->options['success_status'],
214 214
             'policy' => $this->base64Policy,
215 215
             'X-amz-credential' => $this->credentials,
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         if ($addKey) {
224 224
             // Note: The Key (filename) will need to be populated with JS on upload
225 225
             // if anything other than the filename is wanted.
226
-            $inputs['key'] = $this->options['valid_prefix'] . $this->options['default_filename'];
226
+            $inputs['key'] = $this->options['valid_prefix'].$this->options['default_filename'];
227 227
         }
228 228
 
229 229
         return $inputs;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     {
241 241
         $inputs = [];
242 242
         foreach ($this->getFormInputs($addKey) as $name => $value) {
243
-            $inputs[] = '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
243
+            $inputs[] = '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
244 244
         }
245 245
         return implode(PHP_EOL, $inputs);
246 246
     }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
             'expiration' => $this->getExpirationDate(),
273 273
             'conditions' => [
274 274
                 ['bucket' => $this->bucket],
275
-                ['acl' => (string)$this->options['acl']],
275
+                ['acl' => (string) $this->options['acl']],
276 276
                 ['starts-with', '$key', $this->options['valid_prefix']],
277 277
                 $this->getPolicyContentTypeArray(),
278 278
                 ['content-length-range', 0, $this->mbToBytes($this->options['max_file_size'])],
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     private function addAdditionalInputs($policy)
300 300
     {
301 301
         foreach ($this->options['additional_inputs'] as $name => $value) {
302
-            $policy['conditions'][] = ['starts-with', '$' . $name, $value];
302
+            $policy['conditions'][] = ['starts-with', '$'.$name, $value];
303 303
         }
304 304
         return $policy;
305 305
     }
@@ -311,13 +311,13 @@  discard block
 block discarded – undo
311 311
     {
312 312
         $signatureData = [
313 313
             $this->getShortDateFormat(),
314
-            (string)$this->region,
314
+            (string) $this->region,
315 315
             self::SERVICE,
316 316
             self::REQUEST_TYPE
317 317
         ];
318 318
 
319 319
         // Iterates over the data (defined in the array above), hashing it each time.
320
-        $initial = 'AWS4' . $this->secret;
320
+        $initial = 'AWS4'.$this->secret;
321 321
         $signingKey = array_reduce($signatureData, function($key, $data) {
322 322
             return $this->keyHash($data, $key);
323 323
         }, $initial);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
             }
150 150
 
151 151
             return "//" . self::SERVICE . $middle . ".amazonaws.com" . "/" . urlencode($this->bucket);
152
-        }else{
152
+        } else{
153 153
             return "//" . $server . "/" . urlencode($this->bucket);
154 154
         }
155 155
     }
Please login to merge, or discard this patch.