@@ -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 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | public function resolveProviders() |
| 96 | 96 | { |
| 97 | 97 | foreach ($this->getProviders() as $provider) { |
| 98 | - if (! isset($this->instances[$provider])) { |
|
| 98 | + if (!isset($this->instances[$provider])) { |
|
| 99 | 99 | $this->instances[$provider] = $this->createProvider($provider); |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | $class = __NAMESPACE__ . "\Strategies\\{$shortName}"; |
| 122 | 122 | |
| 123 | - if (! class_exists($class)) { |
|
| 123 | + if (!class_exists($class)) { |
|
| 124 | 124 | throw new IpProviderClassNotExistException("{$class} 不存在"); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $response = $this->getOriginalInfo(); |
| 153 | 153 | |
| 154 | - if (! $response['success']) { |
|
| 154 | + if (!$response['success']) { |
|
| 155 | 155 | return (new NullDataMapper())->setInfo(['ip' => $this->getIp()]); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - if (! $this->dataMapper) { |
|
| 158 | + if (!$this->dataMapper) { |
|
| 159 | 159 | $this->dataMapper = new DataMapper(); |
| 160 | 160 | |
| 161 | 161 | return $this->dataMapper->setInfo($response); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function getRequestHandler() |
| 173 | 173 | { |
| 174 | - if (! $this->requestHandler) { |
|
| 174 | + if (!$this->requestHandler) { |
|
| 175 | 175 | return $this->requestHandler = new RequestHandler(); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | public function getIp() |
| 251 | 251 | { |
| 252 | - if (! $this->ip) { |
|
| 252 | + if (!$this->ip) { |
|
| 253 | 253 | throw new \Exception('请先设置 ip'); |
| 254 | 254 | } |
| 255 | 255 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | public function getProviderConfig(string $provider): array |
| 278 | 278 | { |
| 279 | - if (! isset($this->providerConfig[$provider])) { |
|
| 279 | + if (!isset($this->providerConfig[$provider])) { |
|
| 280 | 280 | return []; |
| 281 | 281 | } |
| 282 | 282 | |