diff vendor/symfony/validator/Mapping/GenericMetadata.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
line wrap: on
line diff
--- a/vendor/symfony/validator/Mapping/GenericMetadata.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/validator/Mapping/GenericMetadata.php	Thu Feb 28 13:21:36 2019 +0000
@@ -32,7 +32,7 @@
      *           class' serialized representation. Do not access it. Use
      *           {@link getConstraints()} and {@link findConstraints()} instead.
      */
-    public $constraints = array();
+    public $constraints = [];
 
     /**
      * @var array
@@ -41,7 +41,7 @@
      *           class' serialized representation. Do not access it. Use
      *           {@link findConstraints()} instead.
      */
-    public $constraintsByGroup = array();
+    public $constraintsByGroup = [];
 
     /**
      * The strategy for cascading objects.
@@ -80,12 +80,12 @@
      */
     public function __sleep()
     {
-        return array(
+        return [
             'constraints',
             'constraintsByGroup',
             'cascadingStrategy',
             'traversalStrategy',
-        );
+        ];
     }
 
     /**
@@ -95,8 +95,8 @@
     {
         $constraints = $this->constraints;
 
-        $this->constraints = array();
-        $this->constraintsByGroup = array();
+        $this->constraints = [];
+        $this->constraintsByGroup = [];
 
         foreach ($constraints as $constraint) {
             $this->addConstraint(clone $constraint);
@@ -122,11 +122,7 @@
     public function addConstraint(Constraint $constraint)
     {
         if ($constraint instanceof Traverse) {
-            throw new ConstraintDefinitionException(sprintf(
-                'The constraint "%s" can only be put on classes. Please use '.
-                '"Symfony\Component\Validator\Constraints\Valid" instead.',
-                get_class($constraint)
-            ));
+            throw new ConstraintDefinitionException(sprintf('The constraint "%s" can only be put on classes. Please use "Symfony\Component\Validator\Constraints\Valid" instead.', \get_class($constraint)));
         }
 
         if ($constraint instanceof Valid && null === $constraint->groups) {
@@ -181,7 +177,7 @@
      */
     public function hasConstraints()
     {
-        return count($this->constraints) > 0;
+        return \count($this->constraints) > 0;
     }
 
     /**
@@ -193,7 +189,7 @@
     {
         return isset($this->constraintsByGroup[$group])
             ? $this->constraintsByGroup[$group]
-            : array();
+            : [];
     }
 
     /**