@@ -171,8 +171,8 @@ protected function parsePrivateNet(array $privateNets)
171171 foreach ($ privateNets as $ privateNet ) {
172172 $ parsed [] = new ServerPrivateNet ($ privateNet ->network , $ privateNet ->ip , $ privateNet ->alias_ips , $ privateNet ->mac_address );
173173 }
174- return $ parsed ;
175174
175+ return $ parsed ;
176176 }
177177
178178 /**
@@ -207,9 +207,9 @@ public function reload()
207207 public function powerOn (): ?APIResponse
208208 {
209209 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/poweron ' ));
210- if (!HetznerAPIClient::hasError ($ response )) {
210+ if (! HetznerAPIClient::hasError ($ response )) {
211211 return APIResponse::create ([
212- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
212+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
213213 ], $ response ->getHeaders ());
214214 }
215215
@@ -226,9 +226,9 @@ public function powerOn(): ?APIResponse
226226 public function softReboot (): ?APIResponse
227227 {
228228 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/reboot ' ));
229- if (!HetznerAPIClient::hasError ($ response )) {
229+ if (! HetznerAPIClient::hasError ($ response )) {
230230 return APIResponse::create ([
231- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
231+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
232232 ], $ response ->getHeaders ());
233233 }
234234
@@ -245,9 +245,9 @@ public function softReboot(): ?APIResponse
245245 public function reset (): ?APIResponse
246246 {
247247 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/reset ' ));
248- if (!HetznerAPIClient::hasError ($ response )) {
248+ if (! HetznerAPIClient::hasError ($ response )) {
249249 return APIResponse::create ([
250- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
250+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
251251 ], $ response ->getHeaders ());
252252 }
253253
@@ -264,9 +264,9 @@ public function reset(): ?APIResponse
264264 public function shutdown (): ?APIResponse
265265 {
266266 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/shutdown ' ));
267- if (!HetznerAPIClient::hasError ($ response )) {
267+ if (! HetznerAPIClient::hasError ($ response )) {
268268 return APIResponse::create ([
269- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
269+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
270270 ], $ response ->getHeaders ());
271271 }
272272
@@ -283,9 +283,9 @@ public function shutdown(): ?APIResponse
283283 public function powerOff (): ?APIResponse
284284 {
285285 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/poweroff ' ));
286- if (!HetznerAPIClient::hasError ($ response )) {
286+ if (! HetznerAPIClient::hasError ($ response )) {
287287 return APIResponse::create ([
288- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
288+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
289289 ], $ response ->getHeaders ());
290290 }
291291
@@ -302,8 +302,8 @@ public function powerOff(): ?APIResponse
302302 public function resetRootPassword (): ?APIResponse
303303 {
304304 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/reset_password ' ));
305- if (!HetznerAPIClient::hasError ($ response )) {
306- $ payload = json_decode ((string )$ response ->getBody ());
305+ if (! HetznerAPIClient::hasError ($ response )) {
306+ $ payload = json_decode ((string ) $ response ->getBody ());
307307
308308 return APIResponse::create ([
309309 'action ' => Action::parse ($ payload ->action ),
@@ -331,8 +331,8 @@ public function enableRescue($type = 'linux64', $ssh_keys = []): ?APIResponse
331331 'ssh_keys ' => $ ssh_keys ,
332332 ],
333333 ]);
334- if (!HetznerAPIClient::hasError ($ response )) {
335- $ payload = json_decode ((string )$ response ->getBody ());
334+ if (! HetznerAPIClient::hasError ($ response )) {
335+ $ payload = json_decode ((string ) $ response ->getBody ());
336336
337337 return APIResponse::create ([
338338 'action ' => Action::parse ($ payload ->action ),
@@ -353,9 +353,9 @@ public function enableRescue($type = 'linux64', $ssh_keys = []): ?APIResponse
353353 public function disableRescue (): ?APIResponse
354354 {
355355 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/disable_rescue ' ));
356- if (!HetznerAPIClient::hasError ($ response )) {
356+ if (! HetznerAPIClient::hasError ($ response )) {
357357 return APIResponse::create ([
358- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
358+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
359359 ], $ response ->getHeaders ());
360360 }
361361
@@ -378,14 +378,14 @@ public function createImage(string $description = '', string $type = 'snapshot',
378378 'description ' => $ description ,
379379 'type ' => $ type ,
380380 ];
381- if (!empty ($ labels )) {
381+ if (! empty ($ labels )) {
382382 $ payload ['labels ' ] = $ labels ;
383383 }
384384 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/create_image ' ), [
385385 'json ' => $ payload ,
386386 ]);
387- if (!HetznerAPIClient::hasError ($ response )) {
388- $ payload = json_decode ((string )$ response ->getBody ());
387+ if (! HetznerAPIClient::hasError ($ response )) {
388+ $ payload = json_decode ((string ) $ response ->getBody ());
389389
390390 return APIResponse::create ([
391391 'action ' => Action::parse ($ payload ->action ),
@@ -411,8 +411,8 @@ public function rebuildFromImage(Image $image): ?APIResponse
411411 'image ' => $ image ->id ?: $ image ->name ,
412412 ],
413413 ]);
414- if (!HetznerAPIClient::hasError ($ response )) {
415- $ payload = json_decode ((string )$ response ->getBody ());
414+ if (! HetznerAPIClient::hasError ($ response )) {
415+ $ payload = json_decode ((string ) $ response ->getBody ());
416416
417417 return APIResponse::create (array_merge ([
418418 'action ' => Action::parse ($ payload ->action ),
@@ -439,9 +439,9 @@ public function changeType(ServerType $serverType, bool $upgradeDisk = false): ?
439439 'upgrade_disk ' => $ upgradeDisk ,
440440 ],
441441 ]);
442- if (!HetznerAPIClient::hasError ($ response )) {
442+ if (! HetznerAPIClient::hasError ($ response )) {
443443 return APIResponse::create ([
444- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
444+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
445445 ], $ response ->getHeaders ());
446446 }
447447
@@ -458,9 +458,9 @@ public function changeType(ServerType $serverType, bool $upgradeDisk = false): ?
458458 public function enableBackups (string $ backupWindow = null ): ?APIResponse
459459 {
460460 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/enable_backup ' ));
461- if (!HetznerAPIClient::hasError ($ response )) {
461+ if (! HetznerAPIClient::hasError ($ response )) {
462462 return APIResponse::create ([
463- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
463+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
464464 ], $ response ->getHeaders ());
465465 }
466466
@@ -477,9 +477,9 @@ public function enableBackups(string $backupWindow = null): ?APIResponse
477477 public function disableBackups (): ?APIResponse
478478 {
479479 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/disable_backup ' ));
480- if (!HetznerAPIClient::hasError ($ response )) {
480+ if (! HetznerAPIClient::hasError ($ response )) {
481481 return APIResponse::create ([
482- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
482+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
483483 ], $ response ->getHeaders ());
484484 }
485485
@@ -501,9 +501,9 @@ public function attachISO(ISO $iso): ?APIResponse
501501 'iso ' => $ iso ->name ?: $ iso ->id ,
502502 ],
503503 ]);
504- if (!HetznerAPIClient::hasError ($ response )) {
504+ if (! HetznerAPIClient::hasError ($ response )) {
505505 return APIResponse::create ([
506- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
506+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
507507 ], $ response ->getHeaders ());
508508 }
509509
@@ -520,9 +520,9 @@ public function attachISO(ISO $iso): ?APIResponse
520520 public function detachISO (): ?APIResponse
521521 {
522522 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/detach_iso ' ));
523- if (!HetznerAPIClient::hasError ($ response )) {
523+ if (! HetznerAPIClient::hasError ($ response )) {
524524 return APIResponse::create ([
525- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
525+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
526526 ], $ response ->getHeaders ());
527527 }
528528
@@ -546,9 +546,9 @@ public function changeReverseDNS(string $ip, string $dnsPtr): ?APIResponse
546546 'dns_ptr ' => $ dnsPtr ,
547547 ],
548548 ]);
549- if (!HetznerAPIClient::hasError ($ response )) {
549+ if (! HetznerAPIClient::hasError ($ response )) {
550550 return APIResponse::create ([
551- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
551+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
552552 ], $ response ->getHeaders ());
553553 }
554554
@@ -568,10 +568,10 @@ public function changeReverseDNS(string $ip, string $dnsPtr): ?APIResponse
568568 */
569569 public function metrics (string $ type , string $ start , string $ end , int $ step = null )
570570 {
571- $ response = $ this ->httpClient ->get ($ this ->replaceServerIdInUri ('servers/{id}/metrics? ' ) . http_build_query (compact ('type ' , 'start ' , 'end ' , 'step ' )));
572- if (!HetznerAPIClient::hasError ($ response )) {
571+ $ response = $ this ->httpClient ->get ($ this ->replaceServerIdInUri ('servers/{id}/metrics? ' ). http_build_query (compact ('type ' , 'start ' , 'end ' , 'step ' )));
572+ if (! HetznerAPIClient::hasError ($ response )) {
573573 return APIResponse::create ([
574- 'metrics ' => json_decode ((string )$ response ->getBody ())->metrics ,
574+ 'metrics ' => json_decode ((string ) $ response ->getBody ())->metrics ,
575575 ], $ response ->getHeaders ());
576576 }
577577
@@ -588,9 +588,9 @@ public function metrics(string $type, string $start, string $end, int $step = nu
588588 public function delete (): ?APIResponse
589589 {
590590 $ response = $ this ->httpClient ->delete ($ this ->replaceServerIdInUri ('servers/{id} ' ));
591- if (!HetznerAPIClient::hasError ($ response )) {
591+ if (! HetznerAPIClient::hasError ($ response )) {
592592 return APIResponse::create ([
593- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
593+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
594594 ], $ response ->getHeaders ());
595595 }
596596
@@ -610,9 +610,9 @@ public function update(array $data)
610610 $ response = $ this ->httpClient ->put ($ this ->replaceServerIdInUri ('servers/{id} ' ), [
611611 'json ' => $ data ,
612612 ]);
613- if (!HetznerAPIClient::hasError ($ response )) {
613+ if (! HetznerAPIClient::hasError ($ response )) {
614614 return APIResponse::create ([
615- 'server ' => self ::parse (json_decode ((string )$ response ->getBody ())->server ),
615+ 'server ' => self ::parse (json_decode ((string ) $ response ->getBody ())->server ),
616616 ], $ response ->getHeaders ());
617617 }
618618
@@ -629,8 +629,8 @@ public function update(array $data)
629629 public function requestConsole (): ?APIResponse
630630 {
631631 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/request_console ' ));
632- if (!HetznerAPIClient::hasError ($ response )) {
633- $ payload = json_decode ((string )$ response ->getBody ());
632+ if (! HetznerAPIClient::hasError ($ response )) {
633+ $ payload = json_decode ((string ) $ response ->getBody ());
634634
635635 return APIResponse::create ([
636636 'action ' => Action::parse ($ payload ->action ),
@@ -659,9 +659,9 @@ public function changeProtection(bool $delete = true, bool $rebuild = true): ?AP
659659 'rebuild ' => $ rebuild ,
660660 ],
661661 ]);
662- if (!HetznerAPIClient::hasError ($ response )) {
662+ if (! HetznerAPIClient::hasError ($ response )) {
663663 return APIResponse::create ([
664- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
664+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
665665 ], $ response ->getHeaders ());
666666 }
667667
@@ -689,9 +689,9 @@ public function attachToNetwork(Network $network, string $ip = null, array $alia
689689 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/attach_to_network ' ), [
690690 'json ' => $ payload ,
691691 ]);
692- if (!HetznerAPIClient::hasError ($ response )) {
692+ if (! HetznerAPIClient::hasError ($ response )) {
693693 return APIResponse::create ([
694- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
694+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
695695 ], $ response ->getHeaders ());
696696 }
697697
@@ -712,9 +712,9 @@ public function detachFromNetwork(Network $network)
712712 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/detach_from_network ' ), [
713713 'json ' => $ payload ,
714714 ]);
715- if (!HetznerAPIClient::hasError ($ response )) {
715+ if (! HetznerAPIClient::hasError ($ response )) {
716716 return APIResponse::create ([
717- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
717+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
718718 ], $ response ->getHeaders ());
719719 }
720720
@@ -736,9 +736,9 @@ public function changeAliasIPs(Network $network, array $aliasIps)
736736 $ response = $ this ->httpClient ->post ($ this ->replaceServerIdInUri ('servers/{id}/actions/change_alias_ips ' ), [
737737 'json ' => $ payload ,
738738 ]);
739- if (!HetznerAPIClient::hasError ($ response )) {
739+ if (! HetznerAPIClient::hasError ($ response )) {
740740 return APIResponse::create ([
741- 'action ' => Action::parse (json_decode ((string )$ response ->getBody ())->action ),
741+ 'action ' => Action::parse (json_decode ((string ) $ response ->getBody ())->action ),
742742 ], $ response ->getHeaders ());
743743 }
744744
0 commit comments