Skip to content

Commit

Permalink
Run fix_formatting.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
uphlewis committed Jul 3, 2023
1 parent e2c04e8 commit 6e15129
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 32 deletions.
17 changes: 7 additions & 10 deletions src/CentralNicReseller/Helper/CentralNicResellerApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ public function initiateTransfer(
?RegisterContactParams $adminContact = null,
?RegisterContactParams $techContact = null,
?RegisterContactParams $billingContact = null
): array
{
): array {
if (!Utils::tldSupportsTransferContacts(Utils::getTld($domain))) {
$ownerContact = null;
$adminContact = null;
Expand All @@ -137,31 +136,31 @@ public function initiateTransfer(
if ($ownerContact) {
if ($ownerContact->register) {
$params['ownercontact0'] = $this->transformContactParams($ownerContact->register);
} else if ($ownerContact->id) {
} elseif ($ownerContact->id) {
$params['ownercontact0'] = $ownerContact->id;
}
}

if ($adminContact) {
if ($adminContact->register) {
$params['admincontact0'] = $this->transformContactParams($adminContact->register);
} else if ($adminContact->id) {
} elseif ($adminContact->id) {
$params['admincontact0'] = $adminContact->id;
}
}

if ($techContact) {
if ($techContact->register) {
$params['techcontact0'] = $this->transformContactParams($techContact->register);
} else if ($techContact->id) {
} elseif ($techContact->id) {
$params['techcontact0'] = $techContact->id;
}
}

if ($billingContact) {
if ($billingContact->register) {
$params['billingcontact0'] = $this->transformContactParams($billingContact->register);
} else if ($billingContact->id) {
} elseif ($billingContact->id) {
$params['billingcontact0'] = $billingContact->id;
}
}
Expand Down Expand Up @@ -193,7 +192,7 @@ private function transformContactParams(ContactParams $contact): array
*/
public function createContact(ContactParams $contact): string
{
$result = $this->runCommand('AddContact', $this->transformContactParams($contact))->getHash();
$result = $this->runCommand('AddContact', $this->transformContactParams($contact))->getHash();

return $result['PROPERTY']['CONTACT'][0];
}
Expand All @@ -206,8 +205,7 @@ public function register(
RegisterContactParams $adminContact,
RegisterContactParams $techContact,
RegisterContactParams $billingContact
): array
{
): array {
$params = [
'domain' => $domain,
'period' => $period
Expand Down Expand Up @@ -256,4 +254,3 @@ public function updateNameservers(string $domain, array $nameservers): array
return $this->runCommand('ModifyDomain', $params)->getHash();
}
}

2 changes: 1 addition & 1 deletion src/CentralNicReseller/Helper/CentralNicResellerLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(LoggerInterface $logger)
$this->logger = $logger;
}

public function log($post, $r, $error = null): void
public function log($post, $r, $error = null): void
{
// Compile the Message
$message = implode("\n", [
Expand Down
3 changes: 1 addition & 2 deletions src/CentralNicReseller/Helper/EppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ private static function generateValidAuthCode(int $length = 16): 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) {
Expand Down
6 changes: 1 addition & 5 deletions src/CentralNicReseller/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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
);

Expand Down Expand Up @@ -182,7 +182,6 @@ public function transfer(TransferParams $params): DomainResult
throw $this->errorResult(sprintf('Transfer for %s domain successfully initiated!', $domainName), [
'transfer_id' => $transferId
]);

} catch (eppException $e) {
$this->_eppExceptionHandler($e);
}
Expand Down Expand Up @@ -259,7 +258,6 @@ public function updateNameservers(UpdateNameserversParams $params): NameserversR
}

try {

$this->api()->updateNameservers($domainName, $params->pluckHosts());

$result = collect($params->pluckHosts())
Expand Down Expand Up @@ -301,7 +299,6 @@ public function setLock(LockParams $params): DomainResult
$this->epp()->setRegistrarLock($domainName, $addStatuses, $removeStatuses);

return $this->_getInfo($domainName, sprintf("Lock %s!", $lock ? 'enabled' : 'disabled'));

} catch (eppException $e) {
return $this->_eppExceptionHandler($e);
}
Expand Down Expand Up @@ -390,7 +387,6 @@ protected function connect(): EppConnection
}

return $this->connection;

} catch (eppException $e) {
switch ($e->getCode()) {
case 2200:
Expand Down
19 changes: 9 additions & 10 deletions src/RealtimeRegister/Helper/RealtimeRegisterApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ public function register(string $domainName, array $contacts, array $nameservers
];
}

$body = array(
$body = [
'customer' => $this->configuration->customer,
'period' => 12,
'registrant' => $contacts[self::CONTACT_TYPE_REGISTRANT],
'contacts' => $queryContacts,
'ns' => $nameservers,
);
];

$this->makeRequest($command, null, $body, "POST");
}
Expand Down Expand Up @@ -301,7 +301,7 @@ public function getDomainEppCode(string $domainName): ?string
public function setAuthCode(string $domainName): ?string
{
$command = "/v2/domains/{$domainName}/update";
$body = array('authcode' => '');
$body = ['authcode' => ''];

$this->makeRequest($command, null, $body, "POST");

Expand All @@ -311,7 +311,7 @@ public function setAuthCode(string $domainName): ?string
public function setRenewalMode(string $domainName, bool $autoRenew)
{
$command = "/v2/domains/{$domainName}/update";
$body = array('autoRenew' => $autoRenew);
$body = ['autoRenew' => $autoRenew];

$this->makeRequest($command, null, $body, "POST");
}
Expand Down Expand Up @@ -340,7 +340,7 @@ public function setRegistrarLock(string $domainName, bool $lock): void

$command = "/v2/domains/{$domainName}/update";

$body = array('status' => array_values($statuses));
$body = ['status' => array_values($statuses)];

$this->makeRequest($command, null, $body, "POST");
}
Expand All @@ -349,7 +349,7 @@ public function renew(string $domainName, int $period): void
{
$command = "/v2/domains/{$domainName}/renew";

$body = array('period' => $period * 12);
$body = ['period' => $period * 12];

$this->makeRequest($command, null, $body, "POST");
}
Expand All @@ -361,7 +361,7 @@ public function updateNameservers(string $domainName, array $nameservers): array
{
$command = "/v2/domains/{$domainName}/update";

$body = array('ns' => $nameservers);
$body = ['ns' => $nameservers];

$this->makeRequest($command, null, $body, "POST");

Expand All @@ -385,9 +385,9 @@ public function createHost(string $host, ?string $ip = null)
$version = 'V6';
}

$body = array('addresses' => [['address' => $ip,
$body = ['addresses' => [['address' => $ip,
'ipVersion' => $version
]]);
]]];

$this->makeRequest($command, null, $body, "POST");
}
Expand Down Expand Up @@ -507,7 +507,6 @@ public function poll(int $limit, ?Carbon $since): ?array
$domain = $entity['identifier'] ?? '';
$messageDateTime = Carbon::parse($entity['createdDate']);


$notifications[] = DomainNotification::create()
->setId($messageId)
->setType(DomainNotification::TYPE_TRANSFER_IN)
Expand Down
5 changes: 1 addition & 4 deletions src/RealtimeRegister/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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
);

Expand Down Expand Up @@ -136,7 +136,6 @@ private function getRegisterParams(array $params): array
if (!$this->api()->getContact($registrantID)) {
throw $this->errorResult("Invalid registrant ID provided!", $params);
}

} else {
if (!Arr::has($params, 'registrant.register')) {
throw $this->errorResult('Registrant contact data is required!');
Expand All @@ -153,7 +152,6 @@ private function getRegisterParams(array $params): array
if (!$this->api()->getContact($adminID)) {
throw $this->errorResult("Invalid registrant ID provided!", $params);
}

} else {
if (!Arr::has($params, 'admin.register')) {
throw $this->errorResult('Admin contact data is required!');
Expand Down Expand Up @@ -232,7 +230,6 @@ public function transfer(TransferParams $params): DomainResult
$transferId = $this->api()->initiateTransfer($domainName, $eppCode, $contacts);

throw $this->errorResult(sprintf('Transfer for %s domain successfully created!', $domainName), ['transfer_id' => $transferId]);

} catch (\Throwable $e) {
$this->handleException($e, $params);
}
Expand Down

0 comments on commit 6e15129

Please sign in to comment.