Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2d3ec5b

Browse filesBrowse files
[VarDumper] fix serializing Stub instances
1 parent eb32993 commit 2d3ec5b
Copy full SHA for 2d3ec5b

File tree

Expand file treeCollapse file tree

1 file changed

+13
-10
lines changed
Filter options
  • src/Symfony/Component/VarDumper/Cloner
Expand file treeCollapse file tree

1 file changed

+13
-10
lines changed

‎src/Symfony/Component/VarDumper/Cloner/Stub.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Cloner/Stub.php
+13-10Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,25 @@ class Stub
3939
public $position = 0;
4040
public $attr = [];
4141

42+
private static $defaults = [];
43+
4244
/**
4345
* @internal
4446
*/
4547
public function __sleep()
4648
{
47-
$this->serialized = [$this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr];
49+
$properties = [];
4850

49-
return ['serialized'];
50-
}
51+
if (!isset(self::$defaults[$c = \get_class($this)])) {
52+
self::$defaults[$c] = get_class_vars($c);
53+
}
5154

52-
/**
53-
* @internal
54-
*/
55-
public function __wakeup()
56-
{
57-
list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = $this->serialized;
58-
unset($this->serialized);
55+
foreach (self::$defaults[$c] as $k => $v) {
56+
if ($this->$k !== $v) {
57+
$properties[] = $k;
58+
}
59+
}
60+
61+
return $properties;
5962
}
6063
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.