@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | $missing = array_diff_key(array_flip($this->getRequiredOptions()), $options); |
| 135 | 135 | |
| 136 | - if (! empty($missing)) { |
|
| 136 | + if (!empty($missing)) { |
|
| 137 | 137 | throw new InvalidArgumentException( |
| 138 | - 'Required options not defined: ' . implode(', ', array_keys($missing)) |
|
| 138 | + 'Required options not defined: '.implode(', ', array_keys($missing)) |
|
| 139 | 139 | ); |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | $apiList = $this->getApiList(); |
| 165 | 165 | |
| 166 | - if (! array_key_exists($command, $apiList)) { |
|
| 166 | + if (!array_key_exists($command, $apiList)) { |
|
| 167 | 167 | throw new RuntimeException( |
| 168 | 168 | "Call to unsupported API command [{$command}], this call is not present in the API list." |
| 169 | 169 | ); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | foreach ($apiList[$command]['params'] as $key => $value) { |
| 173 | - if (! array_key_exists($key, $options) && (bool) $value['required']) { |
|
| 173 | + if (!array_key_exists($key, $options) && (bool) $value['required']) { |
|
| 174 | 174 | throw new InvalidArgumentException( |
| 175 | 175 | "Missing argument [{$key}] for command [{$command}] must be of type [{$value['type']}]." |
| 176 | 176 | ); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | // To prevent the signature from being escaped we simply append |
| 269 | 269 | // the signature to the previously build query. |
| 270 | - return $query . '&signature=' . $signature; |
|
| 270 | + return $query.'&signature='.$signature; |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | /** |
@@ -282,9 +282,9 @@ discard block |
||
| 282 | 282 | public function getApiList() |
| 283 | 283 | { |
| 284 | 284 | if (is_null($this->apiList)) { |
| 285 | - $path = __DIR__ . '/../cache/api_list.php'; |
|
| 285 | + $path = __DIR__.'/../cache/api_list.php'; |
|
| 286 | 286 | |
| 287 | - if (! file_exists($path)) { |
|
| 287 | + if (!file_exists($path)) { |
|
| 288 | 288 | throw new RuntimeException( |
| 289 | 289 | "Cloudstack Client API list not found. This file needs to be generated before using the client." |
| 290 | 290 | ); |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $query = trim($query, '?&'); |
| 320 | 320 | |
| 321 | 321 | if ($query) { |
| 322 | - return $url . '?' . $query; |
|
| 322 | + return $url.'?'.$query; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | return $url; |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | { |
| 336 | 336 | // We need to modify the nested array keys to get them accepted by Cloudstack. |
| 337 | 337 | // For example 'details[0][key]' should resolve to 'details[0].key'. |
| 338 | - array_walk($params, function (&$value, $key) { |
|
| 338 | + array_walk($params, function(&$value, $key) { |
|
| 339 | 339 | if (is_array($value)) { |
| 340 | 340 | $parsedParams = []; |
| 341 | 341 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $result = []; |
| 367 | 367 | |
| 368 | 368 | foreach ($params as $key => $value) { |
| 369 | - if (! is_array($value)) { |
|
| 369 | + if (!is_array($value)) { |
|
| 370 | 370 | $result[$key] = $value; |
| 371 | 371 | } else { |
| 372 | 372 | $result = array_merge($result, static::flattenParams($value)); |