made the esception messages consistent across the board

This commit is contained in:
Fabien Potencier 2019-05-06 12:03:55 +02:00
parent fec95e01a2
commit 84c67193bc
10 changed files with 10 additions and 10 deletions

View File

@ -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);
}

View File

@ -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) {

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;