@@ -64,7 +64,7 @@ |
||
64 | 64 | * Return the list of options that can be passed to the HttpClient |
65 | 65 | * |
66 | 66 | * @param array $options |
67 | - * @return array |
|
67 | + * @return string[] |
|
68 | 68 | */ |
69 | 69 | protected function getAllowedClientOptions(array $options) |
70 | 70 | { |
@@ -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 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | /** |
83 | 83 | * Returns all options that can be configured. |
84 | 84 | * |
85 | - * @return array |
|
85 | + * @return string[] |
|
86 | 86 | */ |
87 | 87 | protected function getConfigurableOptions() |
88 | 88 | { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * Returns all options that are required. |
100 | 100 | * |
101 | - * @return array |
|
101 | + * @return string[] |
|
102 | 102 | */ |
103 | 103 | protected function getRequiredOptions() |
104 | 104 | { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * Returns command method based on the command. |
170 | 170 | * |
171 | 171 | * @param string $command |
172 | - * @return array |
|
172 | + * @return string |
|
173 | 173 | */ |
174 | 174 | public function getCommandMethod($command) |
175 | 175 | { |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * Signs the command parameters. |
228 | 228 | * |
229 | 229 | * @param array $params |
230 | - * @return array |
|
230 | + * @return string |
|
231 | 231 | */ |
232 | 232 | protected function signCommandParameters(array $params = []) |
233 | 233 | { |
@@ -276,7 +276,6 @@ discard block |
||
276 | 276 | /** |
277 | 277 | * Set Cloudstack Client API list. |
278 | 278 | * |
279 | - * @param array $list |
|
280 | 279 | * @return void |
281 | 280 | */ |
282 | 281 | public function setApiList(array $apiList) |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | { |
121 | 121 | $missing = array_diff_key(array_flip($this->getRequiredOptions()), $options); |
122 | 122 | |
123 | - if (! empty($missing)) { |
|
123 | + if (!empty($missing)) { |
|
124 | 124 | throw new InvalidArgumentException( |
125 | - 'Required options not defined: ' . implode(', ', array_keys($missing)) |
|
125 | + 'Required options not defined: '.implode(', ', array_keys($missing)) |
|
126 | 126 | ); |
127 | 127 | } |
128 | 128 | } |
@@ -150,14 +150,14 @@ discard block |
||
150 | 150 | { |
151 | 151 | $apiList = $this->getApiList(); |
152 | 152 | |
153 | - if (! array_key_exists($command, $apiList)) { |
|
153 | + if (!array_key_exists($command, $apiList)) { |
|
154 | 154 | throw new RuntimeException( |
155 | 155 | "Call to unsupported API command [{$command}], this call is not present in the API list." |
156 | 156 | ); |
157 | 157 | } |
158 | 158 | |
159 | 159 | foreach ($apiList[$command]['params'] as $key => $value) { |
160 | - if (! array_key_exists($key, $options) && (bool) $value['required']) { |
|
160 | + if (!array_key_exists($key, $options) && (bool) $value['required']) { |
|
161 | 161 | throw new InvalidArgumentException( |
162 | 162 | "Missing argument [{$key}] for command [{$command}] must be of type [{$value['type']}]." |
163 | 163 | ); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | // To prevent the signature from being escaped we simply append |
246 | 246 | // the signature to the previously build query. |
247 | - return $query . '&signature=' . $signature; |
|
247 | + return $query.'&signature='.$signature; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -259,9 +259,9 @@ discard block |
||
259 | 259 | public function getApiList() |
260 | 260 | { |
261 | 261 | if (is_null($this->apiList)) { |
262 | - $path = __DIR__ . '/../cache/api_list.php'; |
|
262 | + $path = __DIR__.'/../cache/api_list.php'; |
|
263 | 263 | |
264 | - if (! file_exists($path)) { |
|
264 | + if (!file_exists($path)) { |
|
265 | 265 | throw new RuntimeException( |
266 | 266 | "Cloudstack Client API list not found. This file needs to be generated before using the client." |
267 | 267 | ); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $query = trim($query, '?&'); |
327 | 327 | |
328 | 328 | if ($query) { |
329 | - return $url . '?' . $query; |
|
329 | + return $url.'?'.$query; |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | return $url; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | protected function askApiKey(InputInterface $input, OutputInterface $output) |
82 | 82 | { |
83 | 83 | $question = (new Question('Enter API key: ')) |
84 | - ->setValidator(function ($answer) { |
|
84 | + ->setValidator(function($answer) { |
|
85 | 85 | if (is_null($answer)) { |
86 | 86 | throw new \InvalidArgumentException("API key can't be null."); |
87 | 87 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | protected function askSecretKey(InputInterface $input, OutputInterface $output) |
104 | 104 | { |
105 | 105 | $question = (new Question('Enter secret key: ')) |
106 | - ->setValidator(function ($answer) { |
|
106 | + ->setValidator(function($answer) { |
|
107 | 107 | if (is_null($answer)) { |
108 | 108 | throw new \InvalidArgumentException("Secret key can't be null."); |
109 | 109 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $listFile .= " '$name' => array(\n"; |
145 | 145 | $listFile .= " 'description' => '$description',\n"; |
146 | - $listFile .= " 'isasync' => " . ($isAsync ? "true" : "false") . ",\n"; |
|
146 | + $listFile .= " 'isasync' => ".($isAsync ? "true" : "false").",\n"; |
|
147 | 147 | $listFile .= " 'params' => array(\n"; |
148 | 148 | |
149 | 149 | foreach ($api['params'] as $param) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $listFile .= " '$paramName' => array(\n"; |
156 | 156 | $listFile .= " 'description' => '$paramDescription',\n"; |
157 | 157 | $listFile .= " 'type' => '$paramType',\n"; |
158 | - $listFile .= " 'required' => " . ($paramRequired ? "true" : "false") . ",\n"; |
|
158 | + $listFile .= " 'required' => ".($paramRequired ? "true" : "false").",\n"; |
|
159 | 159 | $listFile .= " ),\n"; |
160 | 160 | } |
161 | 161 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $listFile .= ");\n"; |
169 | 169 | |
170 | - file_put_contents(__DIR__ . '/../../cache/api_list.php', $listFile); |
|
170 | + file_put_contents(__DIR__.'/../../cache/api_list.php', $listFile); |
|
171 | 171 | |
172 | 172 | $progress->finish(); |
173 | 173 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function getHelp() |
36 | 36 | { |
37 | - return self::$logo . parent::getHelp(); |
|
37 | + return self::$logo.parent::getHelp(); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |