diff vendor/symfony/validator/Constraints/ChoiceValidator.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
line wrap: on
line diff
--- a/vendor/symfony/validator/Constraints/ChoiceValidator.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/vendor/symfony/validator/Constraints/ChoiceValidator.php	Mon Apr 23 09:46:53 2018 +0100
@@ -58,8 +58,8 @@
             $choices = $constraint->choices;
         }
 
-        if (false === $constraint->strict) {
-            @trigger_error('Setting the strict option of the Choice constraint to false is deprecated since version 3.2 and will be removed in 4.0.', E_USER_DEPRECATED);
+        if (true !== $constraint->strict) {
+            @trigger_error('Not setting the strict option of the Choice constraint to true is deprecated since Symfony 3.4 and will throw an exception in 4.0.', E_USER_DEPRECATED);
         }
 
         if ($constraint->multiple) {
@@ -77,7 +77,7 @@
 
             $count = count($value);
 
-            if ($constraint->min !== null && $count < $constraint->min) {
+            if (null !== $constraint->min && $count < $constraint->min) {
                 $this->context->buildViolation($constraint->minMessage)
                     ->setParameter('{{ limit }}', $constraint->min)
                     ->setPlural((int) $constraint->min)
@@ -87,7 +87,7 @@
                 return;
             }
 
-            if ($constraint->max !== null && $count > $constraint->max) {
+            if (null !== $constraint->max && $count > $constraint->max) {
                 $this->context->buildViolation($constraint->maxMessage)
                     ->setParameter('{{ limit }}', $constraint->max)
                     ->setPlural((int) $constraint->max)