@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $b = preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $ip); |
| 84 | 84 | |
| 85 | - if (! $b) { |
|
| 85 | + if (!$b) { |
|
| 86 | 86 | throw new InvalidIpAddress; |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $providerInstance = []; |
| 98 | 98 | |
| 99 | 99 | foreach ($this->getProviders() as $provider) { |
| 100 | - if (! isset($this->instances[$provider])) { |
|
| 100 | + if (!isset($this->instances[$provider])) { |
|
| 101 | 101 | $this->instances[$provider] = $this->createProvider($provider); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $class = __NAMESPACE__ . "\Strategies\\{$shortName}"; |
| 125 | 125 | |
| 126 | - if (! class_exists($class)) { |
|
| 126 | + if (!class_exists($class)) { |
|
| 127 | 127 | throw new IpProviderClassNotExistException("{$class} 不存在"); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $response = $this->getOriginalInfo(); |
| 156 | 156 | |
| 157 | - if (! $response['success']) { |
|
| 157 | + if (!$response['success']) { |
|
| 158 | 158 | return (new NullDataMapper())->setInfo(['ip' => $this->getIp()]); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - if (! $this->dataMapper) { |
|
| 161 | + if (!$this->dataMapper) { |
|
| 162 | 162 | $this->dataMapper = new DataMapper(); |
| 163 | 163 | |
| 164 | 164 | return $this->dataMapper->setInfo($response); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | public function getRequestHandler() |
| 176 | 176 | { |
| 177 | - if (! $this->requestHandler) { |
|
| 177 | + if (!$this->requestHandler) { |
|
| 178 | 178 | return $this->requestHandler = new RequestHandler(); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function getIp() |
| 252 | 252 | { |
| 253 | - if (! $this->ip) { |
|
| 253 | + if (!$this->ip) { |
|
| 254 | 254 | throw new \Exception('请先设置 ip'); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function getProviderConfig(string $provider) |
| 281 | 281 | { |
| 282 | - if (! isset($this->providerConfig[$provider])) { |
|
| 282 | + if (!isset($this->providerConfig[$provider])) { |
|
| 283 | 283 | return []; |
| 284 | 284 | } |
| 285 | 285 | |