* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\PrestaShop\Adapter\Country; use Country; use PrestaShop\PrestaShop\Core\Domain\Country\Exception\CountryConstraintException; use PrestaShopException; /** * Abstract country handler */ class AbstractCountryHandler { /** * @param Country $country * * @throws CountryConstraintException * @throws PrestaShopException */ protected function validateCountryFields(Country $country): void { if (!$country->validateFields(false) || !$country->validateFieldsLang(false)) { throw new CountryConstraintException('Country contains invalid field values'); } } }