@@ -187,9 +187,9 @@ public function reload()
187187 public function powerOn (): APIResponse
188188 {
189189 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/poweron ' ));
190- if (!HetznerAPIClient::hasError ($ response )) {
190+ if (! HetznerAPIClient::hasError ($ response )) {
191191 return APIResponse::create ([
192- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
192+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
193193 ], $ response ->getHeaders ());
194194 }
195195 }
@@ -204,9 +204,9 @@ public function powerOn(): APIResponse
204204 public function softReboot (): APIResponse
205205 {
206206 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/reboot ' ));
207- if (!HetznerAPIClient::hasError ($ response )) {
207+ if (! HetznerAPIClient::hasError ($ response )) {
208208 return APIResponse::create ([
209- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
209+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
210210 ], $ response ->getHeaders ());
211211 }
212212 }
@@ -221,9 +221,9 @@ public function softReboot(): APIResponse
221221 public function reset (): APIResponse
222222 {
223223 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/reset ' ));
224- if (!HetznerAPIClient::hasError ($ response )) {
224+ if (! HetznerAPIClient::hasError ($ response )) {
225225 return APIResponse::create ([
226- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
226+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
227227 ], $ response ->getHeaders ());
228228 }
229229 }
@@ -238,9 +238,9 @@ public function reset(): APIResponse
238238 public function shutdown (): APIResponse
239239 {
240240 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/shutdown ' ));
241- if (!HetznerAPIClient::hasError ($ response )) {
241+ if (! HetznerAPIClient::hasError ($ response )) {
242242 return APIResponse::create ([
243- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
243+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
244244 ], $ response ->getHeaders ());
245245 }
246246 }
@@ -255,9 +255,9 @@ public function shutdown(): APIResponse
255255 public function powerOff (): APIResponse
256256 {
257257 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/poweroff ' ));
258- if (!HetznerAPIClient::hasError ($ response )) {
258+ if (! HetznerAPIClient::hasError ($ response )) {
259259 return APIResponse::create ([
260- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
260+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
261261 ], $ response ->getHeaders ());
262262 }
263263 }
@@ -272,8 +272,8 @@ public function powerOff(): APIResponse
272272 public function resetRootPassword (): APIResponse
273273 {
274274 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/reset_password ' ));
275- if (!HetznerAPIClient::hasError ($ response )) {
276- $ payload = json_decode ((string )$ response ->getBody ());
275+ if (! HetznerAPIClient::hasError ($ response )) {
276+ $ payload = json_decode ((string ) $ response ->getBody ());
277277
278278 return APIResponse::create ([
279279 'action ' => Action::parse ($ payload ->action ),
@@ -299,8 +299,8 @@ public function enableRescue($type = 'linux64', $ssh_keys = []): APIResponse
299299 'ssh_keys ' => $ ssh_keys ,
300300 ],
301301 ]);
302- if (!HetznerAPIClient::hasError ($ response )) {
303- $ payload = json_decode ((string )$ response ->getBody ());
302+ if (! HetznerAPIClient::hasError ($ response )) {
303+ $ payload = json_decode ((string ) $ response ->getBody ());
304304
305305 return APIResponse::create ([
306306 'action ' => Action::parse ($ payload ->action ),
@@ -319,9 +319,9 @@ public function enableRescue($type = 'linux64', $ssh_keys = []): APIResponse
319319 public function disableRescue (): APIResponse
320320 {
321321 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/disable_rescue ' ));
322- if (!HetznerAPIClient::hasError ($ response )) {
322+ if (! HetznerAPIClient::hasError ($ response )) {
323323 return APIResponse::create ([
324- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
324+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
325325 ], $ response ->getHeaders ());
326326 }
327327 }
@@ -342,14 +342,14 @@ public function createImage(string $description = '', string $type = 'snapshot',
342342 'description ' => $ description ,
343343 'type ' => $ type ,
344344 ];
345- if (!empty ($ labels )) {
345+ if (! empty ($ labels )) {
346346 $ payload ['labels ' ] = $ labels ;
347347 }
348348 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/create_image ' ), [
349349 'json ' => $ payload ,
350350 ]);
351- if (!HetznerAPIClient::hasError ($ response )) {
352- $ payload = json_decode ((string )$ response ->getBody ());
351+ if (! HetznerAPIClient::hasError ($ response )) {
352+ $ payload = json_decode ((string ) $ response ->getBody ());
353353
354354 return APIResponse::create ([
355355 'action ' => Action::parse ($ payload ->action ),
@@ -373,8 +373,8 @@ public function rebuildFromImage(Image $image): APIResponse
373373 'image ' => $ image ->name ,
374374 ],
375375 ]);
376- if (!HetznerAPIClient::hasError ($ response )) {
377- $ payload = json_decode ((string )$ response ->getBody ());
376+ if (! HetznerAPIClient::hasError ($ response )) {
377+ $ payload = json_decode ((string ) $ response ->getBody ());
378378
379379 return APIResponse::create (array_merge ([
380380 'action ' => Action::parse ($ payload ->action ),
@@ -399,9 +399,9 @@ public function changeType(ServerType $serverType, bool $upgradeDisk = false): A
399399 'upgrade_disk ' => $ upgradeDisk ,
400400 ],
401401 ]);
402- if (!HetznerAPIClient::hasError ($ response )) {
402+ if (! HetznerAPIClient::hasError ($ response )) {
403403 return APIResponse::create ([
404- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
404+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
405405 ], $ response ->getHeaders ());
406406 }
407407 }
@@ -416,9 +416,9 @@ public function changeType(ServerType $serverType, bool $upgradeDisk = false): A
416416 public function enableBackups (string $ backupWindow = null ): APIResponse
417417 {
418418 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/enable_backup ' ));
419- if (!HetznerAPIClient::hasError ($ response )) {
419+ if (! HetznerAPIClient::hasError ($ response )) {
420420 return APIResponse::create ([
421- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
421+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
422422 ], $ response ->getHeaders ());
423423 }
424424 }
@@ -433,9 +433,9 @@ public function enableBackups(string $backupWindow = null): APIResponse
433433 public function disableBackups (): APIResponse
434434 {
435435 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/disable_backup ' ));
436- if (!HetznerAPIClient::hasError ($ response )) {
436+ if (! HetznerAPIClient::hasError ($ response )) {
437437 return APIResponse::create ([
438- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
438+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
439439 ], $ response ->getHeaders ());
440440 }
441441 }
@@ -455,9 +455,9 @@ public function attachISO(ISO $iso): APIResponse
455455 'iso ' => $ iso ->name == null ? $ iso ->id : $ iso ->name ,
456456 ],
457457 ]);
458- if (!HetznerAPIClient::hasError ($ response )) {
458+ if (! HetznerAPIClient::hasError ($ response )) {
459459 return APIResponse::create ([
460- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
460+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
461461 ], $ response ->getHeaders ());
462462 }
463463 }
@@ -472,9 +472,9 @@ public function attachISO(ISO $iso): APIResponse
472472 public function detachISO (): APIResponse
473473 {
474474 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/detach_iso ' ));
475- if (!HetznerAPIClient::hasError ($ response )) {
475+ if (! HetznerAPIClient::hasError ($ response )) {
476476 return APIResponse::create ([
477- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
477+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
478478 ], $ response ->getHeaders ());
479479 }
480480 }
@@ -496,9 +496,9 @@ public function changeReverseDNS(string $ip, string $dnsPtr): APIResponse
496496 'dns_ptr ' => $ dnsPtr ,
497497 ],
498498 ]);
499- if (!HetznerAPIClient::hasError ($ response )) {
499+ if (! HetznerAPIClient::hasError ($ response )) {
500500 return APIResponse::create ([
501- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
501+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
502502 ], $ response ->getHeaders ());
503503 }
504504 }
@@ -516,10 +516,10 @@ public function changeReverseDNS(string $ip, string $dnsPtr): APIResponse
516516 */
517517 public function metrics (string $ type , string $ start , string $ end , int $ step = null )
518518 {
519- $ response = $ this ->httpClient ->get ($ this ->replaceServerIdInUri ('servers/{id}/metrics? ' ) . http_build_query (compact ('type ' , 'start ' , 'end ' , 'step ' )));
520- if (!HetznerAPIClient::hasError ($ response )) {
519+ $ response = $ this ->httpClient ->get ($ this ->replaceServerIdInUri ('servers/{id}/metrics? ' ). http_build_query (compact ('type ' , 'start ' , 'end ' , 'step ' )));
520+ if (! HetznerAPIClient::hasError ($ response )) {
521521 return APIResponse::create ([
522- 'metrics ' => json_decode ((string )$ response ->getBody ())->metrics ,
522+ 'metrics ' => json_decode ((string ) $ response ->getBody ())->metrics ,
523523 ], $ response ->getHeaders ());
524524 }
525525 }
@@ -534,9 +534,9 @@ public function metrics(string $type, string $start, string $end, int $step = nu
534534 public function delete (): APIResponse
535535 {
536536 $ response = $ this ->httpClient ->delete ($ this ->replaceServerIdInUri ('servers/{id} ' ));
537- if (!HetznerAPIClient::hasError ($ response )) {
537+ if (! HetznerAPIClient::hasError ($ response )) {
538538 return APIResponse::create ([
539- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
539+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
540540 ], $ response ->getHeaders ());
541541 }
542542 }
@@ -554,9 +554,9 @@ public function update(array $data)
554554 $ response = $ this ->httpClient ->put ($ this ->replaceServerIdInUri ('servers/{id} ' ), [
555555 'json ' => $ data ,
556556 ]);
557- if (!HetznerAPIClient::hasError ($ response )) {
557+ if (! HetznerAPIClient::hasError ($ response )) {
558558 return APIResponse::create ([
559- 'server ' => self ::parse (json_decode ((string )$ response ->getBody ())->server ),
559+ 'server ' => self ::parse (json_decode ((string ) $ response ->getBody ())->server ),
560560 ], $ response ->getHeaders ());
561561 }
562562 }
@@ -571,8 +571,8 @@ public function update(array $data)
571571 public function requestConsole (): APIResponse
572572 {
573573 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/request_console ' ));
574- if (!HetznerAPIClient::hasError ($ response )) {
575- $ payload = json_decode ((string )$ response ->getBody ());
574+ if (! HetznerAPIClient::hasError ($ response )) {
575+ $ payload = json_decode ((string ) $ response ->getBody ());
576576
577577 return APIResponse::create ([
578578 'action ' => Action::parse ($ payload ->action ),
@@ -599,9 +599,9 @@ public function changeProtection(bool $delete = true, bool $rebuild = true): API
599599 'rebuild ' => $ rebuild ,
600600 ],
601601 ]);
602- if (!HetznerAPIClient::hasError ($ response )) {
602+ if (! HetznerAPIClient::hasError ($ response )) {
603603 return APIResponse::create ([
604- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
604+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
605605 ], $ response ->getHeaders ());
606606 }
607607 }
@@ -627,9 +627,9 @@ public function attachToNetwork(Network $network, string $ip = null, array $alia
627627 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/attach_to_network ' ), [
628628 'json ' => $ payload ,
629629 ]);
630- if (!HetznerAPIClient::hasError ($ response )) {
630+ if (! HetznerAPIClient::hasError ($ response )) {
631631 return APIResponse::create ([
632- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
632+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
633633 ], $ response ->getHeaders ());
634634 }
635635 }
@@ -648,9 +648,9 @@ public function detachFromNetwork(Network $network)
648648 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/detach_from_network ' ), [
649649 'json ' => $ payload ,
650650 ]);
651- if (!HetznerAPIClient::hasError ($ response )) {
651+ if (! HetznerAPIClient::hasError ($ response )) {
652652 return APIResponse::create ([
653- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
653+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
654654 ], $ response ->getHeaders ());
655655 }
656656 }
@@ -670,9 +670,9 @@ public function changeAliasIPs(Network $network, array $aliasIps)
670670 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/change_alias_ips ' ), [
671671 'json ' => $ payload ,
672672 ]);
673- if (!HetznerAPIClient::hasError ($ response )) {
673+ if (! HetznerAPIClient::hasError ($ response )) {
674674 return APIResponse::create ([
675- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
675+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
676676 ], $ response ->getHeaders ());
677677 }
678678 }
0 commit comments