Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+11 -11
View File
@@ -34,7 +34,7 @@ class ChoiceValidator extends ConstraintValidator
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Choice');
}
if (!is_array($constraint->choices) && !$constraint->callback) {
if (!\is_array($constraint->choices) && !$constraint->callback) {
throw new ConstraintDefinitionException('Either "choices" or "callback" must be specified on constraint Choice');
}
@@ -42,29 +42,29 @@ class ChoiceValidator extends ConstraintValidator
return;
}
if ($constraint->multiple && !is_array($value)) {
if ($constraint->multiple && !\is_array($value)) {
throw new UnexpectedTypeException($value, 'array');
}
if ($constraint->callback) {
if (!is_callable($choices = array($this->context->getObject(), $constraint->callback))
&& !is_callable($choices = array($this->context->getClassName(), $constraint->callback))
&& !is_callable($choices = $constraint->callback)
if (!\is_callable($choices = array($this->context->getObject(), $constraint->callback))
&& !\is_callable($choices = array($this->context->getClassName(), $constraint->callback))
&& !\is_callable($choices = $constraint->callback)
) {
throw new ConstraintDefinitionException('The Choice constraint expects a valid callback');
}
$choices = call_user_func($choices);
$choices = \call_user_func($choices);
} else {
$choices = $constraint->choices;
}
if (false === $constraint->strict) {
@trigger_error('Setting the strict option of the Choice constraint to false is deprecated since Symfony 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
if (true !== $constraint->strict) {
throw new \RuntimeException('The "strict" option of the Choice constraint should not be used.');
}
if ($constraint->multiple) {
foreach ($value as $_value) {
if (!in_array($_value, $choices, $constraint->strict)) {
if (!\in_array($_value, $choices, true)) {
$this->context->buildViolation($constraint->multipleMessage)
->setParameter('{{ value }}', $this->formatValue($_value))
->setCode(Choice::NO_SUCH_CHOICE_ERROR)
@@ -75,7 +75,7 @@ class ChoiceValidator extends ConstraintValidator
}
}
$count = count($value);
$count = \count($value);
if (null !== $constraint->min && $count < $constraint->min) {
$this->context->buildViolation($constraint->minMessage)
@@ -96,7 +96,7 @@ class ChoiceValidator extends ConstraintValidator
return;
}
} elseif (!in_array($value, $choices, $constraint->strict)) {
} elseif (!\in_array($value, $choices, true)) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
->setCode(Choice::NO_SUCH_CHOICE_ERROR)