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
This commit is contained in:
Fabien Potencier 2019-05-06 13:16:34 +02:00
commit 660b18fe39
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;