| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class IpCannotBeLocatedException extends RuntimeException |
||
| 9 | { |
||
| 10 | /** @var bool */ |
||
| 11 | private $isNonLocatableAddress; |
||
| 12 | |||
| 13 | public function __construct( |
||
| 14 | bool $isNonLocatableAddress, |
||
| 15 | string $message, |
||
| 16 | int $code = 0, |
||
| 17 | ?Throwable $previous = null |
||
| 18 | ) { |
||
| 19 | $this->isNonLocatableAddress = $isNonLocatableAddress; |
||
| 20 | parent::__construct($message, $code, $previous); |
||
| 21 | } |
||
| 22 | |||
| 23 | public static function forEmptyAddress(): self |
||
| 24 | { |
||
| 25 | return new self(true, 'Ignored visit with no IP address'); |
||
| 26 | } |
||
| 27 | |||
| 28 | public static function forLocalhost(): self |
||
| 31 | } |
||
| 32 | |||
| 33 | 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 | public function isNonLocatableAddress(): bool |
||
| 46 |