diff vendor/symfony/validator/DataCollector/ValidatorDataCollector.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
line wrap: on
line diff
--- a/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php	Thu Feb 28 11:14:44 2019 +0000
+++ b/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php	Thu Feb 28 13:11:55 2019 +0000
@@ -45,10 +45,10 @@
 
     public function reset()
     {
-        $this->data = array(
-            'calls' => $this->cloneVar(array()),
+        $this->data = [
+            'calls' => $this->cloneVar([]),
             'violations_count' => 0,
-        );
+        ];
     }
 
     /**
@@ -59,7 +59,7 @@
         $collected = $this->validator->getCollectedData();
         $this->data['calls'] = $this->cloneVar($collected);
         $this->data['violations_count'] = array_reduce($collected, function ($previous, $item) {
-            return $previous + count($item['violations']);
+            return $previous + \count($item['violations']);
         }, 0);
     }
 
@@ -89,9 +89,9 @@
 
     protected function getCasters()
     {
-        return parent::getCasters() + array(
+        return parent::getCasters() + [
             \Exception::class => function (\Exception $e, array $a, Stub $s) {
-                foreach (array("\0Exception\0previous", "\0Exception\0trace") as $k) {
+                foreach (["\0Exception\0previous", "\0Exception\0trace"] as $k) {
                     if (isset($a[$k])) {
                         unset($a[$k]);
                         ++$s->cut;
@@ -101,12 +101,12 @@
                 return $a;
             },
             FormInterface::class => function (FormInterface $f, array $a) {
-                return array(
+                return [
                     Caster::PREFIX_VIRTUAL.'name' => $f->getName(),
-                    Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(get_class($f->getConfig()->getType()->getInnerType())),
+                    Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(\get_class($f->getConfig()->getType()->getInnerType())),
                     Caster::PREFIX_VIRTUAL.'data' => $f->getData(),
-                );
+                ];
             },
-        );
+        ];
     }
 }