| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class GeolocationDbUpdateFailedException extends RuntimeException implements ExceptionInterface |
||
| 11 | { |
||
| 12 | /** @var bool */ |
||
| 13 | private $olderDbExists; |
||
| 14 | |||
| 15 | 18 | public function __construct(bool $olderDbExists, string $message = '', int $code = 0, ?Throwable $previous = null) |
|
| 16 | { |
||
| 17 | 18 | $this->olderDbExists = $olderDbExists; |
|
| 18 | 18 | parent::__construct($message, $code, $previous); |
|
| 19 | } |
||
| 20 | |||
| 21 | 13 | public static function create(bool $olderDbExists, ?Throwable $prev = null): self |
|
| 22 | { |
||
| 23 | 13 | return new self( |
|
| 24 | 13 | $olderDbExists, |
|
| 25 | 13 | 'An error occurred while updating geolocation database, and an older version could not be found', |
|
| 26 | 13 | 0, |
|
| 27 | 13 | $prev |
|
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | 18 | public function olderDbExists(): bool |
|
| 34 | } |
||
| 35 | } |
||
| 36 |