made the esception messages consistent across the board
This commit is contained in:
parent
fec95e01a2
commit
84c67193bc
@ -48,7 +48,7 @@ class Bic extends Constraint
|
|||||||
public function __construct($options = null)
|
public function __construct($options = null)
|
||||||
{
|
{
|
||||||
if (!class_exists(Countries::class)) {
|
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);
|
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class BicValidator extends ConstraintValidator
|
|||||||
$validCountryCode = Countries::exists(substr($canonicalize, 4, 2));
|
$validCountryCode = Countries::exists(substr($canonicalize, 4, 2));
|
||||||
} else {
|
} else {
|
||||||
$validCountryCode = ctype_alpha(substr($canonicalize, 4, 2));
|
$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) {
|
if (!$validCountryCode) {
|
||||||
|
@ -34,7 +34,7 @@ class Country extends Constraint
|
|||||||
public function __construct($options = null)
|
public function __construct($options = null)
|
||||||
{
|
{
|
||||||
if (!class_exists(Countries::class)) {
|
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);
|
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class CountryValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists(Countries::class)) {
|
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;
|
$value = (string) $value;
|
||||||
|
@ -35,7 +35,7 @@ class Currency extends Constraint
|
|||||||
public function __construct($options = null)
|
public function __construct($options = null)
|
||||||
{
|
{
|
||||||
if (!class_exists(Currencies::class)) {
|
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);
|
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class CurrencyValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists(Currencies::class)) {
|
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;
|
$value = (string) $value;
|
||||||
|
@ -34,7 +34,7 @@ class Language extends Constraint
|
|||||||
public function __construct($options = null)
|
public function __construct($options = null)
|
||||||
{
|
{
|
||||||
if (!class_exists(Languages::class)) {
|
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);
|
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class LanguageValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists(Languages::class)) {
|
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;
|
$value = (string) $value;
|
||||||
|
@ -39,7 +39,7 @@ class Locale extends Constraint
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists(Locales::class)) {
|
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);
|
@trigger_error(sprintf('Using the "%s" constraint without the "symfony/intl" component installed is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class LocaleValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists(Locales::class)) {
|
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;
|
$inputValue = (string) $value;
|
||||||
|
Reference in New Issue
Block a user