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