| Total Complexity | 5 | 
| Total Lines | 36 | 
| Duplicated Lines | 0 % | 
| Coverage | 100% | 
| Changes | 0 | ||
| 1 | <?php | ||
| 8 | class IpCannotBeLocatedException extends RuntimeException | ||
| 9 | { | ||
| 10 | /** @var bool */ | ||
| 11 | private $isNonLocatableAddress; | ||
| 12 | |||
| 13 | 14 | public function __construct( | |
| 14 | bool $isNonLocatableAddress, | ||
| 15 | string $message, | ||
| 16 | int $code = 0, | ||
| 17 | ?Throwable $previous = null | ||
| 18 |     ) { | ||
| 19 | 14 | $this->isNonLocatableAddress = $isNonLocatableAddress; | |
| 20 | 14 | parent::__construct($message, $code, $previous); | |
| 21 | } | ||
| 22 | |||
| 23 | 3 | public static function forEmptyAddress(): self | |
| 24 |     { | ||
| 25 | 3 | return new self(true, 'Ignored visit with no IP address'); | |
| 26 | } | ||
| 27 | |||
| 28 | 2 | public static function forLocalhost(): self | |
| 31 | } | ||
| 32 | |||
| 33 | 4 | public static function forError(Throwable $e): self | |
| 36 | } | ||
| 37 | |||
| 38 | /** | ||
| 39 | * Tells if this error belongs to an address that will never be possible locate | ||
| 40 | */ | ||
| 41 | 10 | public function isNonLocatableAddress(): bool | |
| 46 |