Skip to content

Commit f4b663a

Browse files
committed
minor #31392 Make the exception messages consistent across the board (fabpot)
This PR was merged into the 4.3-dev branch. Discussion ---------- Make the exception messages consistent across the board | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 84c67193bc made the esception messages consistent across the board
2 parents 16e6570 + 26396aa commit f4b663a

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

Constraints/Bic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Bic extends Constraint
4848
public function __construct($options = null)
4949
{
5050
if (!class_exists(Countries::class)) {
51-
// throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__));
51+
// throw new LogicException('The Intl component is required to use the Bic constraint. Try running "composer require symfony/intl".');
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
}
5454

Constraints/BicValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function validate($value, Constraint $constraint)
109109
$validCountryCode = Countries::exists(substr($canonicalize, 4, 2));
110110
} else {
111111
$validCountryCode = ctype_alpha(substr($canonicalize, 4, 2));
112-
// throw new LogicException('The "symfony/intl" component is required to use the Bic constraint.');
112+
// throw new LogicException('The Intl component is required to use the Bic constraint. Try running "composer require symfony/intl".');
113113
}
114114

115115
if (!$validCountryCode) {

Constraints/Country.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Country extends Constraint
3434
public function __construct($options = null)
3535
{
3636
if (!class_exists(Countries::class)) {
37-
// throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__));
37+
// throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".');
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
}
4040

Constraints/CountryValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function validate($value, Constraint $constraint)
4343
}
4444

4545
if (!class_exists(Countries::class)) {
46-
throw new LogicException('The "symfony/intl" component is required to use the Country constraint.');
46+
throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".');
4747
}
4848

4949
$value = (string) $value;

Constraints/Currency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Currency extends Constraint
3535
public function __construct($options = null)
3636
{
3737
if (!class_exists(Currencies::class)) {
38-
// throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__));
38+
// throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".');
3939
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
4040
}
4141

Constraints/CurrencyValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function validate($value, Constraint $constraint)
4444
}
4545

4646
if (!class_exists(Currencies::class)) {
47-
throw new LogicException('The "symfony/intl" component is required to use the Currency constraint.');
47+
throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".');
4848
}
4949

5050
$value = (string) $value;

Constraints/Language.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Language extends Constraint
3434
public function __construct($options = null)
3535
{
3636
if (!class_exists(Languages::class)) {
37-
// throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__));
37+
// throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".');
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
}
4040

Constraints/LanguageValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function validate($value, Constraint $constraint)
4343
}
4444

4545
if (!class_exists(Languages::class)) {
46-
throw new LogicException('The "symfony/intl" component is required to use the Language constraint.');
46+
throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".');
4747
}
4848

4949
$value = (string) $value;

Constraints/Locale.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct($options = null)
3939
}
4040

4141
if (!class_exists(Locales::class)) {
42-
// throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__));
42+
// throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".');
4343
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
4444
}
4545

Constraints/LocaleValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function validate($value, Constraint $constraint)
4343
}
4444

4545
if (!class_exists(Locales::class)) {
46-
throw new LogicException('The "symfony/intl" component is required to use the Locale constraint.');
46+
throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".');
4747
}
4848

4949
$inputValue = (string) $value;

0 commit comments

Comments
 (0)