Skip to content

Commit 9d60467

Browse files
committed
[Intl] Rename Regions to Countries
1 parent 80b4019 commit 9d60467

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Constraints/Bic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14-
use Symfony\Component\Intl\Regions;
14+
use Symfony\Component\Intl\Countries;
1515
use Symfony\Component\PropertyAccess\PropertyAccess;
1616
use Symfony\Component\Validator\Constraint;
1717
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
@@ -47,7 +47,7 @@ class Bic extends Constraint
4747

4848
public function __construct($options = null)
4949
{
50-
if (!class_exists(Regions::class)) {
50+
if (!class_exists(Countries::class)) {
5151
// throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__));
5252
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
5353
}

Constraints/BicValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14-
use Symfony\Component\Intl\Regions;
14+
use Symfony\Component\Intl\Countries;
1515
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
1616
use Symfony\Component\PropertyAccess\PropertyAccess;
1717
use Symfony\Component\PropertyAccess\PropertyAccessor;
@@ -105,8 +105,8 @@ public function validate($value, Constraint $constraint)
105105
}
106106

107107
// @deprecated since Symfony 4.2, will throw in 5.0
108-
if (class_exists(Regions::class)) {
109-
$validCountryCode = Regions::exists(substr($canonicalize, 4, 2));
108+
if (class_exists(Countries::class)) {
109+
$validCountryCode = Countries::exists(substr($canonicalize, 4, 2));
110110
} else {
111111
$validCountryCode = ctype_alpha(substr($canonicalize, 4, 2));
112112
// throw new LogicException('The "symfony/intl" component is required to use the Bic constraint.');

Constraints/Country.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14-
use Symfony\Component\Intl\Regions;
14+
use Symfony\Component\Intl\Countries;
1515
use Symfony\Component\Validator\Constraint;
1616
use Symfony\Component\Validator\Exception\LogicException;
1717

@@ -33,7 +33,7 @@ class Country extends Constraint
3333

3434
public function __construct($options = null)
3535
{
36-
if (!class_exists(Regions::class)) {
36+
if (!class_exists(Countries::class)) {
3737
// throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__));
3838
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
3939
}

Constraints/CountryValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Constraints;
1313

14-
use Symfony\Component\Intl\Regions;
14+
use Symfony\Component\Intl\Countries;
1515
use Symfony\Component\Validator\Constraint;
1616
use Symfony\Component\Validator\ConstraintValidator;
1717
use Symfony\Component\Validator\Exception\LogicException;
@@ -42,13 +42,13 @@ public function validate($value, Constraint $constraint)
4242
throw new UnexpectedValueException($value, 'string');
4343
}
4444

45-
if (!class_exists(Regions::class)) {
45+
if (!class_exists(Countries::class)) {
4646
throw new LogicException('The "symfony/intl" component is required to use the Country constraint.');
4747
}
4848

4949
$value = (string) $value;
5050

51-
if (!Regions::exists($value)) {
51+
if (!Countries::exists($value)) {
5252
$this->context->buildViolation($constraint->message)
5353
->setParameter('{{ value }}', $this->formatValue($value))
5454
->setCode(Country::NO_SUCH_COUNTRY_ERROR)

0 commit comments

Comments
 (0)