From ba4ac7d80843b491dfeb44f06907e2fde708d337 Mon Sep 17 00:00:00 2001 From: Harry Lewis Date: Thu, 1 Jun 2023 00:37:04 +0100 Subject: [PATCH] Run fix_formatting.sh --- src/CentralNic/Data/Configuration.php | 1 - src/CentralNic/Helper/CentralNicApi.php | 6 ++---- src/CentralNic/Provider.php | 9 +-------- src/CoccaEpp/Provider.php | 1 - src/Hexonet/Provider.php | 2 -- src/NameSilo/Provider.php | 4 ---- src/Namecheap/Provider.php | 1 - src/OpenProvider/Provider.php | 1 - 8 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/CentralNic/Data/Configuration.php b/src/CentralNic/Data/Configuration.php index 6412e98..1b11320 100644 --- a/src/CentralNic/Data/Configuration.php +++ b/src/CentralNic/Data/Configuration.php @@ -17,7 +17,6 @@ */ class Configuration extends DataSet { - public static function rules(): Rules { return new Rules([ diff --git a/src/CentralNic/Helper/CentralNicApi.php b/src/CentralNic/Helper/CentralNicApi.php index 7d7f049..ad4e0cf 100644 --- a/src/CentralNic/Helper/CentralNicApi.php +++ b/src/CentralNic/Helper/CentralNicApi.php @@ -185,8 +185,7 @@ public function register( int $period, array $contacts, array $nameServers - ): array - { + ): array { $domain = new eppDomain($domainName, $contacts[eppContactHandle::CONTACT_TYPE_REGISTRANT], [ new eppContactHandle($contacts[eppContactHandle::CONTACT_TYPE_ADMIN], eppContactHandle::CONTACT_TYPE_ADMIN), new eppContactHandle($contacts[eppContactHandle::CONTACT_TYPE_TECH], eppContactHandle::CONTACT_TYPE_TECH), @@ -324,8 +323,7 @@ public function updateEppCode(string $domainName): string public function updateNameServers( string $domainName, array $nameservers - ): string - { + ): string { // If new nameservers are given, get the old ones to remove them $hosts = []; foreach ($nameservers as $nameserver) { diff --git a/src/CentralNic/Provider.php b/src/CentralNic/Provider.php index 9e8cd93..64944f9 100644 --- a/src/CentralNic/Provider.php +++ b/src/CentralNic/Provider.php @@ -99,7 +99,7 @@ public function domainAvailabilityCheck(DacParams $params): DacResult { $sld = Utils::normalizeSld($params->sld); $domains = array_map( - fn($tld) => $sld . "." . Utils::normalizeTld($tld), + fn ($tld) => $sld . "." . Utils::normalizeTld($tld), $params->tlds ); @@ -163,7 +163,6 @@ private function getRegisterParams(RegisterDomainParams $params): array if (!$this->api()->getContactInfo($registrantID)) { throw $this->errorResult("Invalid registrant ID provided!", $params); } - } else { if (!Arr::has($params, 'registrant.register')) { throw $this->errorResult('Registrant contact data is required!'); @@ -180,7 +179,6 @@ private function getRegisterParams(RegisterDomainParams $params): array if (!$this->api()->getContactInfo($adminID)) { throw $this->errorResult("Invalid registrant ID provided!", $params); } - } else { if (!Arr::has($params, 'admin.register')) { throw $this->errorResult('Admin contact data is required!'); @@ -207,7 +205,6 @@ private function getRegisterParams(RegisterDomainParams $params): array ); } - if (Arr::has($params, 'billing.id')) { $billingID = $params->billing->id; @@ -251,7 +248,6 @@ public function transfer(TransferParams $params): DomainResult $transferId = $this->api()->initiateTransfer($domainName, $eppCode, intval($params->renew_years)); throw $this->errorResult(sprintf('Transfer for %s domain successfully created!', $domainName), ['transfer_id' => $transferId]); - } catch (eppException $e) { $this->_eppExceptionHandler($e, $params->toArray()); } @@ -328,7 +324,6 @@ public function updateNameservers(UpdateNameserversParams $params): NameserversR } try { - $this->api()->updateNameServers($domainName, $nameServers); $hosts = $this->api()->getHosts($domainName); @@ -374,7 +369,6 @@ public function setLock(LockParams $params): DomainResult $this->api()->setRegistrarLock($domainName, $addStatuses, $removeStatuses); return $this->_getInfo($domainName, sprintf("Lock %s!", $lock ? 'enabled' : 'disabled')); - } catch (eppException $e) { return $this->_eppExceptionHandler($e, $params->toArray()); } @@ -447,7 +441,6 @@ protected function connect(): EppConnection } return $this->connection; - } catch (eppException $e) { switch ($e->getCode()) { case 2001: diff --git a/src/CoccaEpp/Provider.php b/src/CoccaEpp/Provider.php index d062b96..2af7b5e 100644 --- a/src/CoccaEpp/Provider.php +++ b/src/CoccaEpp/Provider.php @@ -173,7 +173,6 @@ public function domainAvailabilityCheck(DacParams $params): DacResult } } - foreach ($checkDomains ?? [] as $chk) { $canRegister = boolval($chk['@name']['avail']); $canTransfer = false; diff --git a/src/Hexonet/Provider.php b/src/Hexonet/Provider.php index 562bd2a..a343850 100644 --- a/src/Hexonet/Provider.php +++ b/src/Hexonet/Provider.php @@ -826,7 +826,6 @@ protected function updateContact(string $contactId, ContactParams $params): Cont throw $this->errorResult('Invalid registrant ID provided!', compact('contactId', 'params'), [], $e); } - // Set Parameters for the update query $eppContactType = $params->type; @@ -888,7 +887,6 @@ protected function _eppExceptionHandler(eppException $exception, $data = [], $de throw $this->errorResult($errorMessage, $data, $debug, $exception); } - /** * Ensures the provider instance has a logged in EppConnection and returns it. * diff --git a/src/NameSilo/Provider.php b/src/NameSilo/Provider.php index 1eea001..1376cb4 100644 --- a/src/NameSilo/Provider.php +++ b/src/NameSilo/Provider.php @@ -156,7 +156,6 @@ public function poll(PollParams $params): PollResult 'domain' => $domain ], 'checkTransferStatus', 'GET'); - if ($since !== null && $since->gt(Carbon::parse((string)$checkTransferStatus->reply->date))) { continue; } @@ -213,7 +212,6 @@ public function register(RegisterDomainParams $params): DomainResult 'billing' => $this->_handleContact($params->billing, $domain), ]; - for ($i = 1; $i <= self::MAX_CUSTOM_NAMESERVERS; $i++) { if (Arr::has($params, 'nameservers.ns' . $i)) { $data['ns' . $i] = Arr::get($params, 'nameservers.ns' . $i . '.host'); @@ -734,7 +732,6 @@ protected function display_xml_error($error, $xml) return "$return\n---\n"; } - /** * @param string $email * @param string $telephone @@ -979,7 +976,6 @@ protected function _allContactInfo(string $registrantId, string $billingId, stri return PromiseUtils::all($promises)->wait(); } - protected function formatDate(?string $date): ?string { if (!isset($date)) { diff --git a/src/Namecheap/Provider.php b/src/Namecheap/Provider.php index ea1154b..d265cfc 100644 --- a/src/Namecheap/Provider.php +++ b/src/Namecheap/Provider.php @@ -192,7 +192,6 @@ private function checkRegisterParams(RegisterDomainParams $params): void } } - /** * @param ArrayAccess $params * @param string $prefix diff --git a/src/OpenProvider/Provider.php b/src/OpenProvider/Provider.php index 23d906e..2d0a5d0 100644 --- a/src/OpenProvider/Provider.php +++ b/src/OpenProvider/Provider.php @@ -930,7 +930,6 @@ public function poll(PollParams $params): PollResult $offset += $limit; - if (!isset($response['data']['results']) || $response['data']['total'] == 0) { break; }