Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | 3 | public function resolveIpLocation(string $ipAddress): Model\Location |
|
24 | { |
||
25 | 3 | $error = null; |
|
26 | |||
27 | 3 | foreach ($this->resolvers as $resolver) { |
|
28 | try { |
||
29 | 3 | return $resolver->resolveIpLocation($ipAddress); |
|
30 | 2 | } catch (WrongIpException $e) { |
|
31 | 2 | $error = $e; |
|
32 | } |
||
33 | } |
||
34 | |||
35 | // If this instruction is reached, it means no resolver was capable of resolving the address |
||
36 | 1 | throw WrongIpException::fromIpAddress($ipAddress, $error); |
|
37 | } |
||
39 |