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