Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / vendor / symfony / var-dumper / Caster / StubCaster.php
index 45e0022d1f455bddcd9066b6644fb26764e93667..b0bf5dc80d6414e4c3fe4651d04020e800d3731a 100644 (file)
@@ -28,6 +28,12 @@ class StubCaster
             $stub->value = $c->value;
             $stub->handle = $c->handle;
             $stub->cut = $c->cut;
+            $stub->attr = $c->attr;
+
+            if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) {
+                $stub->type = Stub::TYPE_STRING;
+                $stub->class = Stub::STRING_BINARY;
+            }
 
             $a = array();
         }
@@ -43,7 +49,7 @@ class StubCaster
     public static function cutInternals($obj, array $a, Stub $stub, $isNested)
     {
         if ($isNested) {
-            $stub->cut += count($a);
+            $stub->cut += \count($a);
 
             return array();
         }
@@ -54,9 +60,11 @@ class StubCaster
     public static function castEnum(EnumStub $c, array $a, Stub $stub, $isNested)
     {
         if ($isNested) {
-            $stub->class = '';
+            $stub->class = $c->dumpKeys ? '' : null;
             $stub->handle = 0;
             $stub->value = null;
+            $stub->cut = $c->cut;
+            $stub->attr = $c->attr;
 
             $a = array();