Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / var-dumper / Cloner / Stub.php
index f58a57a72761b0002765b2e2456cc28aa656394a..3b8e60d90ee6efd75fbc1e150db008ab3f33afd6 100644 (file)
@@ -16,19 +16,19 @@ namespace Symfony\Component\VarDumper\Cloner;
  *
  * @author Nicolas Grekas <p@tchwork.com>
  */
-class Stub
+class Stub implements \Serializable
 {
-    const TYPE_REF = 'ref';
-    const TYPE_STRING = 'string';
-    const TYPE_ARRAY = 'array';
-    const TYPE_OBJECT = 'object';
-    const TYPE_RESOURCE = 'resource';
+    const TYPE_REF = 1;
+    const TYPE_STRING = 2;
+    const TYPE_ARRAY = 3;
+    const TYPE_OBJECT = 4;
+    const TYPE_RESOURCE = 5;
 
-    const STRING_BINARY = 'bin';
-    const STRING_UTF8 = 'utf8';
+    const STRING_BINARY = 1;
+    const STRING_UTF8 = 2;
 
-    const ARRAY_ASSOC = 'assoc';
-    const ARRAY_INDEXED = 'indexed';
+    const ARRAY_ASSOC = 1;
+    const ARRAY_INDEXED = 2;
 
     public $type = self::TYPE_REF;
     public $class = '';
@@ -37,4 +37,21 @@ class Stub
     public $handle = 0;
     public $refCount = 0;
     public $position = 0;
+    public $attr = array();
+
+    /**
+     * @internal
+     */
+    public function serialize()
+    {
+        return \serialize(array($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr));
+    }
+
+    /**
+     * @internal
+     */
+    public function unserialize($serialized)
+    {
+        list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = \unserialize($serialized);
+    }
 }