@@ -146,11 +146,11 @@ |
||
146 | 146 | $promise = $client->getAsync('https://api.ipify.org'); |
147 | 147 | |
148 | 148 | $promise->then( |
149 | - function ($response) { |
|
149 | + function($response) { |
|
150 | 150 | $publicIp = $response->getBody()->getContents(); |
151 | 151 | return $publicIp; |
152 | 152 | }, |
153 | - function ($exception) { |
|
153 | + function($exception) { |
|
154 | 154 | return 'Error: ' . $exception->getMessage(); |
155 | 155 | } |
156 | 156 | ); |
@@ -62,7 +62,9 @@ |
||
62 | 62 | // $netmask is a CIDR size block |
63 | 63 | // fix the range argument |
64 | 64 | $x = explode('.', $range); |
65 | - while (count($x) < 4) $x[] = '0'; |
|
65 | + while (count($x) < 4) { |
|
66 | + $x[] = '0'; |
|
67 | + } |
|
66 | 68 | list($a, $b, $c, $d) = $x; |
67 | 69 | $range = sprintf("%u.%u.%u.%u", empty($a) ? '0' : $a, empty($b) ? '0' : $b, empty($c) ? '0' : $c, empty($d) ? '0' : $d); |
68 | 70 | $range_dec = ip2long($range); |