@@ -163,24 +163,24 @@ discard block |
||
| 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 | 180 | if ($this->options['accelerate']) { |
| 181 | - return "//" . urlencode($this->bucket) . "." . self::SERVICE . "-accelerate.amazonaws.com"; |
|
| 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 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $this->options['acl'] = new Acl($this->options['acl']); |
| 208 | 208 | |
| 209 | 209 | // Return HTTP code must be a string |
| 210 | - $this->options['success_status'] = (string)$this->options['success_status']; |
|
| 210 | + $this->options['success_status'] = (string) $this->options['success_status']; |
|
| 211 | 211 | |
| 212 | 212 | // Encryption option is just a helper to set this header, but we need to set it early on so it |
| 213 | 213 | // affects both the policy and the inputs generated. |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | $inputs = [ |
| 247 | 247 | 'Content-Type' => $this->options['content_type'], |
| 248 | - 'acl' => (string)$this->options['acl'], |
|
| 248 | + 'acl' => (string) $this->options['acl'], |
|
| 249 | 249 | 'success_action_status' => $this->options['success_status'], |
| 250 | 250 | 'policy' => $this->base64Policy, |
| 251 | 251 | 'X-amz-credential' => $this->credentials, |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | if ($addKey) { |
| 260 | 260 | // Note: The Key (filename) will need to be populated with JS on upload |
| 261 | 261 | // if anything other than the filename is wanted. |
| 262 | - $inputs['key'] = $this->options['valid_prefix'] . $this->options['default_filename']; |
|
| 262 | + $inputs['key'] = $this->options['valid_prefix'].$this->options['default_filename']; |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | return $inputs; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | { |
| 277 | 277 | $inputs = []; |
| 278 | 278 | foreach ($this->getFormInputs($addKey) as $name => $value) { |
| 279 | - $inputs[] = '<input type="hidden" name="' . $name . '" value="' . $value . '" />'; |
|
| 279 | + $inputs[] = '<input type="hidden" name="'.$name.'" value="'.$value.'" />'; |
|
| 280 | 280 | } |
| 281 | 281 | return implode(PHP_EOL, $inputs); |
| 282 | 282 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | 'expiration' => $this->getExpirationDate(), |
| 309 | 309 | 'conditions' => [ |
| 310 | 310 | ['bucket' => $this->bucket], |
| 311 | - ['acl' => (string)$this->options['acl']], |
|
| 311 | + ['acl' => (string) $this->options['acl']], |
|
| 312 | 312 | ['starts-with', '$key', $this->options['valid_prefix']], |
| 313 | 313 | $this->getPolicyContentTypeArray(), |
| 314 | 314 | ['content-length-range', 0, $this->mbToBytes($this->options['max_file_size'])], |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | private function addAdditionalInputs($policy) |
| 336 | 336 | { |
| 337 | 337 | foreach ($this->options['additional_inputs'] as $name => $value) { |
| 338 | - $policy['conditions'][] = ['starts-with', '$' . $name, $value]; |
|
| 338 | + $policy['conditions'][] = ['starts-with', '$'.$name, $value]; |
|
| 339 | 339 | } |
| 340 | 340 | return $policy; |
| 341 | 341 | } |
@@ -347,13 +347,13 @@ discard block |
||
| 347 | 347 | { |
| 348 | 348 | $signatureData = [ |
| 349 | 349 | $this->getShortDateFormat(), |
| 350 | - (string)$this->region, |
|
| 350 | + (string) $this->region, |
|
| 351 | 351 | self::SERVICE, |
| 352 | 352 | self::REQUEST_TYPE |
| 353 | 353 | ]; |
| 354 | 354 | |
| 355 | 355 | // Iterates over the data (defined in the array above), hashing it each time. |
| 356 | - $initial = 'AWS4' . $this->secret; |
|
| 356 | + $initial = 'AWS4'.$this->secret; |
|
| 357 | 357 | $signingKey = array_reduce($signatureData, function($key, $data) { |
| 358 | 358 | return $this->keyHash($data, $key); |
| 359 | 359 | }, $initial); |