Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / http-foundation / Session / Attribute / NamespacedAttributeBag.php
index abbf37ee7c33cf4be0a671ecf17c134a5bbdac55..2f1e01a971a944e360369560b8224c93a5c6cdd8 100644 (file)
@@ -110,7 +110,7 @@ class NamespacedAttributeBag extends AttributeBag
         }
 
         $parts = explode($this->namespaceCharacter, $name);
-        if (count($parts) < 2) {
+        if (\count($parts) < 2) {
             if (!$writeContext) {
                 return $array;
             }
@@ -120,11 +120,17 @@ class NamespacedAttributeBag extends AttributeBag
             return $array;
         }
 
-        unset($parts[count($parts) - 1]);
+        unset($parts[\count($parts) - 1]);
 
         foreach ($parts as $part) {
             if (null !== $array && !array_key_exists($part, $array)) {
-                $array[$part] = $writeContext ? array() : null;
+                if (!$writeContext) {
+                    $null = null;
+
+                    return $null;
+                }
+
+                $array[$part] = array();
             }
 
             $array = &$array[$part];