From 84c67193bc4fac3a3be4fc9dd3956afc2f29c82b Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 6 May 2019 12:03:55 +0200 Subject: [PATCH] made the esception messages consistent across the board --- src/Symfony/Component/Validator/Constraints/Bic.php | 2 +- src/Symfony/Component/Validator/Constraints/BicValidator.php | 2 +- src/Symfony/Component/Validator/Constraints/Country.php | 2 +- .../Component/Validator/Constraints/CountryValidator.php | 2 +- src/Symfony/Component/Validator/Constraints/Currency.php | 2 +- .../Component/Validator/Constraints/CurrencyValidator.php | 2 +- src/Symfony/Component/Validator/Constraints/Language.php | 2 +- .../Component/Validator/Constraints/LanguageValidator.php | 2 +- src/Symfony/Component/Validator/Constraints/Locale.php | 2 +- src/Symfony/Component/Validator/Constraints/LocaleValidator.php | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/Bic.php b/src/Symfony/Component/Validator/Constraints/Bic.php index 7b0a8a3bcd..8164bf6c2d 100644 --- a/src/Symfony/Component/Validator/Constraints/Bic.php +++ b/src/Symfony/Component/Validator/Constraints/Bic.php @@ -48,7 +48,7 @@ class Bic extends Constraint public function __construct($options = null) { if (!class_exists(Countries::class)) { - // throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__)); + // throw new LogicException('The Intl component is required to use the Bic constraint. Try running "composer require symfony/intl".'); @trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED); } diff --git a/src/Symfony/Component/Validator/Constraints/BicValidator.php b/src/Symfony/Component/Validator/Constraints/BicValidator.php index f542913b9f..bc306d35e8 100644 --- a/src/Symfony/Component/Validator/Constraints/BicValidator.php +++ b/src/Symfony/Component/Validator/Constraints/BicValidator.php @@ -109,7 +109,7 @@ class BicValidator extends ConstraintValidator $validCountryCode = Countries::exists(substr($canonicalize, 4, 2)); } else { $validCountryCode = ctype_alpha(substr($canonicalize, 4, 2)); - // throw new LogicException('The "symfony/intl" component is required to use the Bic constraint.'); + // throw new LogicException('The Intl component is required to use the Bic constraint. Try running "composer require symfony/intl".'); } if (!$validCountryCode) { diff --git a/src/Symfony/Component/Validator/Constraints/Country.php b/src/Symfony/Component/Validator/Constraints/Country.php index 431ee49de2..9c8cd4ada2 100644 --- a/src/Symfony/Component/Validator/Constraints/Country.php +++ b/src/Symfony/Component/Validator/Constraints/Country.php @@ -34,7 +34,7 @@ class Country extends Constraint public function __construct($options = null) { if (!class_exists(Countries::class)) { - // throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__)); + // throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".'); @trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED); } diff --git a/src/Symfony/Component/Validator/Constraints/CountryValidator.php b/src/Symfony/Component/Validator/Constraints/CountryValidator.php index f3736ac027..21dd62b034 100644 --- a/src/Symfony/Component/Validator/Constraints/CountryValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CountryValidator.php @@ -43,7 +43,7 @@ class CountryValidator extends ConstraintValidator } if (!class_exists(Countries::class)) { - throw new LogicException('The "symfony/intl" component is required to use the Country constraint.'); + throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".'); } $value = (string) $value; diff --git a/src/Symfony/Component/Validator/Constraints/Currency.php b/src/Symfony/Component/Validator/Constraints/Currency.php index 73ea29488f..580a5cb616 100644 --- a/src/Symfony/Component/Validator/Constraints/Currency.php +++ b/src/Symfony/Component/Validator/Constraints/Currency.php @@ -35,7 +35,7 @@ class Currency extends Constraint public function __construct($options = null) { if (!class_exists(Currencies::class)) { - // throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__)); + // throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".'); @trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED); } diff --git a/src/Symfony/Component/Validator/Constraints/CurrencyValidator.php b/src/Symfony/Component/Validator/Constraints/CurrencyValidator.php index cc25aa738e..2c0ab6ac8e 100644 --- a/src/Symfony/Component/Validator/Constraints/CurrencyValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CurrencyValidator.php @@ -44,7 +44,7 @@ class CurrencyValidator extends ConstraintValidator } if (!class_exists(Currencies::class)) { - throw new LogicException('The "symfony/intl" component is required to use the Currency constraint.'); + throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".'); } $value = (string) $value; diff --git a/src/Symfony/Component/Validator/Constraints/Language.php b/src/Symfony/Component/Validator/Constraints/Language.php index 47b9389557..c8e242d187 100644 --- a/src/Symfony/Component/Validator/Constraints/Language.php +++ b/src/Symfony/Component/Validator/Constraints/Language.php @@ -34,7 +34,7 @@ class Language extends Constraint public function __construct($options = null) { if (!class_exists(Languages::class)) { - // throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__)); + // throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".'); @trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED); } diff --git a/src/Symfony/Component/Validator/Constraints/LanguageValidator.php b/src/Symfony/Component/Validator/Constraints/LanguageValidator.php index b193ceda84..4f9b118d84 100644 --- a/src/Symfony/Component/Validator/Constraints/LanguageValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LanguageValidator.php @@ -43,7 +43,7 @@ class LanguageValidator extends ConstraintValidator } if (!class_exists(Languages::class)) { - throw new LogicException('The "symfony/intl" component is required to use the Language constraint.'); + throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".'); } $value = (string) $value; diff --git a/src/Symfony/Component/Validator/Constraints/Locale.php b/src/Symfony/Component/Validator/Constraints/Locale.php index d56db7cf21..faff564d31 100644 --- a/src/Symfony/Component/Validator/Constraints/Locale.php +++ b/src/Symfony/Component/Validator/Constraints/Locale.php @@ -39,7 +39,7 @@ class Locale extends Constraint } if (!class_exists(Locales::class)) { - // throw new LogicException(sprintf('The "symfony/intl" component is required to use the "%s" constraint.', __CLASS__)); + // throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".'); @trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED); } diff --git a/src/Symfony/Component/Validator/Constraints/LocaleValidator.php b/src/Symfony/Component/Validator/Constraints/LocaleValidator.php index 2a48c0f5ef..f965a0fcf2 100644 --- a/src/Symfony/Component/Validator/Constraints/LocaleValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LocaleValidator.php @@ -43,7 +43,7 @@ class LocaleValidator extends ConstraintValidator } if (!class_exists(Locales::class)) { - throw new LogicException('The "symfony/intl" component is required to use the Locale constraint.'); + throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".'); } $inputValue = (string) $value;