Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / validator / Constraints / Composite.php
index d1391bb0724af2f9fc0d4cc793d75e524997324f..d233f06335e1a135bfae2e1d27a74d59d773164b 100644 (file)
@@ -61,21 +61,21 @@ abstract class Composite extends Constraint
         $compositeOption = $this->getCompositeOption();
         $nestedConstraints = $this->$compositeOption;
 
-        if (!is_array($nestedConstraints)) {
+        if (!\is_array($nestedConstraints)) {
             $nestedConstraints = array($nestedConstraints);
         }
 
         foreach ($nestedConstraints as $constraint) {
             if (!$constraint instanceof Constraint) {
-                if (is_object($constraint)) {
-                    $constraint = get_class($constraint);
+                if (\is_object($constraint)) {
+                    $constraint = \get_class($constraint);
                 }
 
-                throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, get_class($this)));
+                throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, \get_class($this)));
             }
 
             if ($constraint instanceof Valid) {
-                throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint %s. You can only declare the Valid constraint directly on a field or method.', get_class($this)));
+                throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint %s. You can only declare the Valid constraint directly on a field or method.', \get_class($this)));
             }
         }
 
@@ -98,14 +98,8 @@ abstract class Composite extends Constraint
             if (property_exists($constraint, 'groups')) {
                 $excessGroups = array_diff($constraint->groups, $this->groups);
 
-                if (count($excessGroups) > 0) {
-                    throw new ConstraintDefinitionException(sprintf(
-                        'The group(s) "%s" passed to the constraint %s '.
-                        'should also be passed to its containing constraint %s',
-                        implode('", "', $excessGroups),
-                        get_class($constraint),
-                        get_class($this)
-                    ));
+                if (\count($excessGroups) > 0) {
+                    throw new ConstraintDefinitionException(sprintf('The group(s) "%s" passed to the constraint %s should also be passed to its containing constraint %s', implode('", "', $excessGroups), \get_class($constraint), \get_class($this)));
                 }
             } else {
                 $constraint->groups = $this->groups;