composer update
This commit is contained in:
parent
f6abc3dce2
commit
71dfaca858
1753 changed files with 45274 additions and 14619 deletions
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
|
|||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
|
||||
/**
|
||||
* @author Michael Hirschler <michael.vhirsch@gmail.com>
|
||||
|
@ -26,6 +27,10 @@ class BicValidator extends ConstraintValidator
|
|||
*/
|
||||
public function validate($value, Constraint $constraint)
|
||||
{
|
||||
if (!$constraint instanceof Bic) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Bic');
|
||||
}
|
||||
|
||||
if (null === $value || '' === $value) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,10 @@ class CountValidator extends ConstraintValidator
|
|||
*/
|
||||
public function validate($value, Constraint $constraint)
|
||||
{
|
||||
if (!$constraint instanceof Count) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Count');
|
||||
}
|
||||
|
||||
if (null === $value) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -129,6 +129,7 @@ class IbanValidator extends ConstraintValidator
|
|||
'TN' => 'TN59\d{2}\d{3}\d{13}\d{2}', // Tunisia
|
||||
'TR' => 'TR\d{2}\d{5}[\dA-Z]{1}[\dA-Z]{16}', // Turkey
|
||||
'UA' => 'UA\d{2}\d{6}[\dA-Z]{19}', // Ukraine
|
||||
'VA' => 'VA\d{2}\d{3}\d{15}', // Vatican City State
|
||||
'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands, British
|
||||
'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Wallis and Futuna Islands
|
||||
'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Republic of Kosovo
|
||||
|
|
|
@ -66,14 +66,14 @@ class UuidValidator extends ConstraintValidator
|
|||
*/
|
||||
public function validate($value, Constraint $constraint)
|
||||
{
|
||||
if (null === $value || '' === $value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$constraint instanceof Uuid) {
|
||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Uuid');
|
||||
}
|
||||
|
||||
if (null === $value || '' === $value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) {
|
||||
throw new UnexpectedTypeException($value, 'string');
|
||||
}
|
||||
|
|
Reference in a new issue