@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $clientOptions = ['timeout', 'proxy']; |
| 72 | 72 | |
| 73 | 73 | // Only allow turning off ssl verification is it's for a proxy |
| 74 | - if (! empty($options['proxy'])) { |
|
| 74 | + if (!empty($options['proxy'])) { |
|
| 75 | 75 | $clientOptions[] = 'verify'; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | namespace PCextreme\Cloudstack\Util; |
| 6 | 6 | |
| 7 | 7 | use InvalidArgumentException; |
| 8 | -use PCextreme\Cloudstack\Exception\ClientException; |
|
| 9 | 8 | |
| 10 | 9 | trait UrlHelpersTrait |
| 11 | 10 | { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | protected function askApiKey(InputInterface $input, OutputInterface $output) : string |
| 94 | 94 | { |
| 95 | 95 | $question = (new Question('Enter API key: ')) |
| 96 | - ->setValidator(function ($answer) { |
|
| 96 | + ->setValidator(function($answer) { |
|
| 97 | 97 | if (is_null($answer)) { |
| 98 | 98 | throw new \InvalidArgumentException("API key can't be null."); |
| 99 | 99 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | protected function askSecretKey(InputInterface $input, OutputInterface $output) : string |
| 116 | 116 | { |
| 117 | 117 | $question = (new Question('Enter secret key: ')) |
| 118 | - ->setValidator(function ($answer) { |
|
| 118 | + ->setValidator(function($answer) { |
|
| 119 | 119 | if (is_null($answer)) { |
| 120 | 120 | throw new \InvalidArgumentException("Secret key can't be null."); |
| 121 | 121 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $listFile .= "// api_list.php @generated by api:list command\n\n"; |
| 177 | 177 | $listFile .= "return ".var_export($commands, true).";\n"; |
| 178 | 178 | |
| 179 | - file_put_contents(__DIR__ . '/../../cache/api_list.php', $listFile); |
|
| 179 | + file_put_contents(__DIR__.'/../../cache/api_list.php', $listFile); |
|
| 180 | 180 | |
| 181 | 181 | $progress->finish(); |
| 182 | 182 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function getHelp() : string |
| 36 | 36 | { |
| 37 | - return self::$logo . parent::getHelp(); |
|
| 37 | + return self::$logo.parent::getHelp(); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | private function assertRequiredCommandOptions(string $command, array $options = []) : void |
| 173 | 173 | { |
| 174 | - if (! $this->isCommandValid($command)) { |
|
| 174 | + if (!$this->isCommandValid($command)) { |
|
| 175 | 175 | throw new RuntimeException( |
| 176 | 176 | "Call to unsupported API command [{$command}], this call is not present in the API list." |
| 177 | 177 | ); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $missing = array_diff($requiredParameters, $providedParameters); |
| 184 | 184 | |
| 185 | - if (! empty($missing)) { |
|
| 185 | + if (!empty($missing)) { |
|
| 186 | 186 | $missing = implode(', ', $missing); |
| 187 | 187 | |
| 188 | 188 | throw new InvalidArgumentException( |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $commands = $this->getApiList(); |
| 212 | 212 | $parameters = $commands[$command]['params']; |
| 213 | 213 | |
| 214 | - $required = array_filter($parameters, function ($rules) { |
|
| 214 | + $required = array_filter($parameters, function($rules) { |
|
| 215 | 215 | return (bool) $rules['required']; |
| 216 | 216 | }); |
| 217 | 217 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | { |
| 376 | 376 | // We need to modify the nested array keys to get them accepted by Cloudstack. |
| 377 | 377 | // For example 'details[0][key]' should resolve to 'details[0].key'. |
| 378 | - array_walk($params, function (&$value, $key) { |
|
| 378 | + array_walk($params, function(&$value, $key) { |
|
| 379 | 379 | if (is_array($value)) { |
| 380 | 380 | $parsedParams = []; |
| 381 | 381 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | // to encode the values, but we can't encode the keys. This would otherwise |
| 395 | 395 | // compromise the signature. Therefore we can't use http_build_query(). |
| 396 | 396 | $queryParams = $this->flattenParams($params); |
| 397 | - array_walk($queryParams, function (&$value, $key) { |
|
| 397 | + array_walk($queryParams, function(&$value, $key) { |
|
| 398 | 398 | $value = $key.'='.rawurlencode($value); |
| 399 | 399 | }); |
| 400 | 400 | |