@@ -1119,7 +1119,7 @@ |
||
| 1119 | 1119 | |
| 1120 | 1120 | $ac->setInodeUsed(intval($account['inodesused'])); |
| 1121 | 1121 | |
| 1122 | - if (! empty($account['has_backup'])) { |
|
| 1122 | + if (!empty($account['has_backup'])) { |
|
| 1123 | 1123 | $ac->setBackup((bool)$account['has_backup']); |
| 1124 | 1124 | } |
| 1125 | 1125 | |
@@ -107,12 +107,12 @@ |
||
| 107 | 107 | $data = json_decode((string)$response->getBody(), true); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if(array_key_exists("status", $data) && $data['status'] === 0){ |
|
| 110 | + if (array_key_exists("status", $data) && $data['status'] === 0) { |
|
| 111 | 111 | throw ClientExceptions::accessDenied(!empty($data['statusmsg']) ? $data['statusmsg'] : null); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if ($response->getStatusCode() === 403) { |
| 115 | - if (! empty($data['cpanelresult']['error'])) { |
|
| 115 | + if (!empty($data['cpanelresult']['error'])) { |
|
| 116 | 116 | throw ClientExceptions::accessDenied( |
| 117 | 117 | $data['cpanelresult']['error'], |
| 118 | 118 | $data['cpanelresult']['data']['reason'] |
@@ -380,17 +380,17 @@ discard block |
||
| 380 | 380 | $params = ['domain' => $domain]; |
| 381 | 381 | |
| 382 | 382 | $result = $this->client->sendRequest("/json-api/domainuserdata", "GET", $params); |
| 383 | - if(empty($result)){ |
|
| 383 | + if (empty($result)) { |
|
| 384 | 384 | return null; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | - if($result['result'][0]['status'] === 0){ |
|
| 387 | + if ($result['result'][0]['status'] === 0) { |
|
| 388 | 388 | throw new ClientExceptions($result['result'][0]['statusmsg']); |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | $userData = $result['userdata']; |
| 392 | 392 | $domainUser = new DomainUser(); |
| 393 | - $domainUser->setHasCGI((bool) $userData['hascgi']); |
|
| 393 | + $domainUser->setHasCGI((bool)$userData['hascgi']); |
|
| 394 | 394 | $domainUser->setServerName($userData['servername']); |
| 395 | 395 | $domainUser->setOwner($userData['owner']); |
| 396 | 396 | $domainUser->setScriptAlias($userData['scriptalias']); |
@@ -400,11 +400,11 @@ discard block |
||
| 400 | 400 | $domainUser->setGroup($userData['group']); |
| 401 | 401 | $domainUser->setIpAddress($userData['ip']); |
| 402 | 402 | $domainUser->setPort($userData['port']); |
| 403 | - $domainUser->setPhpOpenBaseDirectoryProtect((bool) $userData['phpopenbasedirprotect']); |
|
| 403 | + $domainUser->setPhpOpenBaseDirectoryProtect((bool)$userData['phpopenbasedirprotect']); |
|
| 404 | 404 | |
| 405 | - if($userData['usecanonicalname'] === "Off"){ |
|
| 405 | + if ($userData['usecanonicalname'] === "Off") { |
|
| 406 | 406 | $domainUser->setUseCanonicalName(false); |
| 407 | - }elseif($userData['usecanonicalname'] === "On"){ |
|
| 407 | + }elseif ($userData['usecanonicalname'] === "On") { |
|
| 408 | 408 | $domainUser->setUseCanonicalName(true); |
| 409 | 409 | } |
| 410 | 410 | |
@@ -454,18 +454,18 @@ discard block |
||
| 454 | 454 | ]; |
| 455 | 455 | |
| 456 | 456 | $usersJson = []; |
| 457 | - foreach ($usernames as $username){ |
|
| 457 | + foreach ($usernames as $username) { |
|
| 458 | 458 | $usersJson[$username] = 1; |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | $params['users_json'] = json_encode($usersJson); |
| 462 | 462 | |
| 463 | 463 | $result = $this->client->sendRequest("/json-api/forcepasswordchange", "GET", $params); |
| 464 | - if($result['metadata']['result'] === 0){ |
|
| 464 | + if ($result['metadata']['result'] === 0) { |
|
| 465 | 465 | throw new ClientExceptions($result['metadata']['reason']); |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | - if(!empty($result['data'])){ |
|
| 468 | + if (!empty($result['data'])) { |
|
| 469 | 469 | return $result['updated']; |
| 470 | 470 | } |
| 471 | 471 | |
@@ -487,15 +487,15 @@ discard block |
||
| 487 | 487 | $params = []; |
| 488 | 488 | $result = $this->client->sendRequest("/json-api/get_domain_info", "GET", $params); |
| 489 | 489 | |
| 490 | - if(empty($result)){ |
|
| 490 | + if (empty($result)) { |
|
| 491 | 491 | return null; |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | - if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ |
|
| 494 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
| 495 | 495 | $domains = $result['data']['domains']; |
| 496 | 496 | |
| 497 | 497 | $domainList = []; |
| 498 | - foreach ($domains as $domain){ |
|
| 498 | + foreach ($domains as $domain) { |
|
| 499 | 499 | $do = new Domain(); |
| 500 | 500 | $do->setPort(intval($domain['port'])); |
| 501 | 501 | $do->setUser($domain['user']); |
@@ -506,9 +506,9 @@ discard block |
||
| 506 | 506 | $do->setPhpVersion($domain['php_version']); |
| 507 | 507 | $do->setUserOwner($domain['user_owner']); |
| 508 | 508 | $do->setDomainType($domain['domain_type']); |
| 509 | - $do->setIpv6IsDedicated((bool) $domain['ipv6_is_dedicated']); |
|
| 509 | + $do->setIpv6IsDedicated((bool)$domain['ipv6_is_dedicated']); |
|
| 510 | 510 | $do->setIpv4($domain['ipv4']); |
| 511 | - $do->setModSecurityEnabled((bool) $domain['modsecurity_enabled']); |
|
| 511 | + $do->setModSecurityEnabled((bool)$domain['modsecurity_enabled']); |
|
| 512 | 512 | $do->setDocRoot($domain['docroot']); |
| 513 | 513 | $domainList[] = $do; |
| 514 | 514 | } |