@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | - protected $guzzleOptions = []; |
|
| 38 | + protected $guzzleOptions = [ ]; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Dynadot's API key we should use for HTTP calls. |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $this->setGuzzleOptions([ |
| 90 | 90 | 'max' => 5, |
| 91 | 91 | 'referer' => false, |
| 92 | - 'protocols' => ['https'], |
|
| 92 | + 'protocols' => [ 'https' ], |
|
| 93 | 93 | 'connect_timeout' => 30, |
| 94 | 94 | ]); |
| 95 | 95 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @throws \Sabre\Xml\LibXMLException |
| 104 | 104 | * @throws \Sabre\Xml\ParseException |
| 105 | 105 | */ |
| 106 | - $this->booleanDeserializer = function (Reader $reader) { |
|
| 106 | + $this->booleanDeserializer = function(Reader $reader) { |
|
| 107 | 107 | $value = $reader->parseInnerTree(); |
| 108 | 108 | |
| 109 | 109 | if ($value != 'yes' && $value != 'no') { |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | * @throws \Sabre\Xml\LibXMLException |
| 123 | 123 | * @throws \Sabre\Xml\ParseException |
| 124 | 124 | */ |
| 125 | - $this->contactIdDeserializer = function (Reader $reader) { |
|
| 125 | + $this->contactIdDeserializer = function(Reader $reader) { |
|
| 126 | 126 | $children = $reader->parseInnerTree(); |
| 127 | 127 | |
| 128 | - return $children[0]['value']; |
|
| 128 | + return $children[ 0 ][ 'value' ]; |
|
| 129 | 129 | }; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -165,24 +165,24 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | // set mapping |
| 167 | 167 | $sabreService->elementMap = [ |
| 168 | - '{}NameServers' => function (Reader $reader) { |
|
| 168 | + '{}NameServers' => function(Reader $reader) { |
|
| 169 | 169 | |
| 170 | - $nameservers = []; |
|
| 170 | + $nameservers = [ ]; |
|
| 171 | 171 | $id = ''; |
| 172 | 172 | |
| 173 | 173 | $children = $reader->parseInnerTree(); |
| 174 | 174 | |
| 175 | 175 | foreach ($children as $child) { |
| 176 | - if ($child['name'] == '{}ServerId') { |
|
| 177 | - $id = $child['value']; |
|
| 178 | - } elseif ($child['name'] == '{}ServerName') { |
|
| 179 | - if (!empty($id) && !empty($child['value'])) { |
|
| 176 | + if ($child[ 'name' ] == '{}ServerId') { |
|
| 177 | + $id = $child[ 'value' ]; |
|
| 178 | + } elseif ($child[ 'name' ] == '{}ServerName') { |
|
| 179 | + if (!empty($id) && !empty($child[ 'value' ])) { |
|
| 180 | 180 | $nameserver = new DomainResponse\NameServer(); |
| 181 | 181 | |
| 182 | 182 | $nameserver->ServerId = $id; |
| 183 | - $nameserver->ServerName = $child['value']; |
|
| 183 | + $nameserver->ServerName = $child[ 'value' ]; |
|
| 184 | 184 | |
| 185 | - $nameservers[] = $nameserver; |
|
| 185 | + $nameservers[ ] = $nameserver; |
|
| 186 | 186 | } |
| 187 | 187 | $id = null; |
| 188 | 188 | } |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | $idx = 0; |
| 350 | 350 | // check if there are more than 13 nameservers defined |
| 351 | 351 | foreach ($nameservers as $nameserver) { |
| 352 | - $requestData['ns' . $idx++] = $nameserver; |
|
| 352 | + $requestData[ 'ns' . $idx++ ] = $nameserver; |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | // perform the API call |
@@ -418,23 +418,23 @@ discard block |
||
| 418 | 418 | |
| 419 | 419 | // set mapping |
| 420 | 420 | $sabreService->elementMap = [ |
| 421 | - '{}NameServers' => function (Reader $reader) { |
|
| 421 | + '{}NameServers' => function(Reader $reader) { |
|
| 422 | 422 | |
| 423 | - $nameservers = []; |
|
| 423 | + $nameservers = [ ]; |
|
| 424 | 424 | $id = ''; |
| 425 | 425 | |
| 426 | 426 | $children = $reader->parseInnerTree(); |
| 427 | 427 | |
| 428 | 428 | foreach ($children as $child) { |
| 429 | - if ($child['name'] == '{}ServerId') { |
|
| 430 | - $id = $child['value']; |
|
| 431 | - } elseif ($child['name'] == '{}ServerName') { |
|
| 432 | - if (!empty($id) && !empty($child['value'])) { |
|
| 429 | + if ($child[ 'name' ] == '{}ServerId') { |
|
| 430 | + $id = $child[ 'value' ]; |
|
| 431 | + } elseif ($child[ 'name' ] == '{}ServerName') { |
|
| 432 | + if (!empty($id) && !empty($child[ 'value' ])) { |
|
| 433 | 433 | $nameserver = new DomainResponse\NameServer(); |
| 434 | 434 | $nameserver->ServerId = $id; |
| 435 | - $nameserver->ServerName = $child['value']; |
|
| 435 | + $nameserver->ServerName = $child[ 'value' ]; |
|
| 436 | 436 | |
| 437 | - $nameservers[] = $nameserver; |
|
| 437 | + $nameservers[ ] = $nameserver; |
|
| 438 | 438 | } |
| 439 | 439 | $id = null; |
| 440 | 440 | } |
@@ -442,12 +442,12 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | return $nameservers; |
| 444 | 444 | }, |
| 445 | - '{}DomainInfoList' => function (Reader $reader) { |
|
| 446 | - $domains = []; |
|
| 445 | + '{}DomainInfoList' => function(Reader $reader) { |
|
| 446 | + $domains = [ ]; |
|
| 447 | 447 | |
| 448 | 448 | $tree = $reader->parseInnerTree(); |
| 449 | 449 | foreach ($tree as $item) { |
| 450 | - $domains[] = $item['value'][0]['value']; |
|
| 450 | + $domains[ ] = $item[ 'value' ][ 0 ][ 'value' ]; |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | return $domains; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | try { |
| 17 | 17 | $api = new DynadotApi($apiKey, $logger); |
| 18 | - $api->setNameserversForDomain('exmple.com', ['ns01.example.com', 'ns2.example.net', 'ns03.example.org']); |
|
| 18 | + $api->setNameserversForDomain('exmple.com', [ 'ns01.example.com', 'ns2.example.net', 'ns03.example.org' ]); |
|
| 19 | 19 | echo "OK"; |
| 20 | 20 | } catch (Exception $e) { |
| 21 | 21 | echo $e->getMessage(); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $api = new DynadotApi($apiKey, $logger); |
| 18 | 18 | $list = $api->getDomainList(); |
| 19 | 19 | |
| 20 | - print_r( $list ); |
|
| 20 | + print_r($list); |
|
| 21 | 21 | } catch (Exception $e) { |
| 22 | 22 | echo $e->getMessage(); |
| 23 | 23 | echo "<br>"; |