| Total Complexity | 4 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 12 | #[Package('customer-order')] |
||
| 13 | class CountryException extends HttpException |
||
| 14 | { |
||
| 15 | public const COUNTRY_NOT_FOUND = 'CHECKOUT__COUNTRY_NOT_FOUND'; |
||
| 16 | public const COUNTRY_STATE_NOT_FOUND = 'CHECKOUT__COUNTRY_STATE_NOT_FOUND'; |
||
| 17 | |||
| 18 | public static function countryNotFound(string $id): self |
||
| 19 | { |
||
| 20 | if (!Feature::isActive('v6.6.0.0')) { |
||
| 21 | return new CountryNotFoundException($id); |
||
|
|
|||
| 22 | } |
||
| 23 | |||
| 24 | return new self( |
||
| 25 | Response::HTTP_BAD_REQUEST, |
||
| 26 | self::COUNTRY_NOT_FOUND, |
||
| 27 | 'Country with id "{{ countryId }}" not found.', |
||
| 28 | ['countryId' => $id] |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | public static function countryStateNotFound(string $id): self |
||
| 43 | ); |
||
| 44 | } |
||
| 46 |