Skip to content

Commit 90acd03

Browse files
minor symfony#32672 [VarDumper] revert private properties handling (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] revert private properties handling | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 9bad905 revert private properties handling
2 parents 828ba66 + 9bad905 commit 90acd03

File tree

1 file changed

+3
-9
lines changed
  • src/Symfony/Component/VarDumper/Cloner

1 file changed

+3
-9
lines changed

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

+3-9
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@ public function __sleep()
4949
$properties = [];
5050

5151
if (!isset(self::$defaultProperties[$c = \get_class($this)])) {
52-
$defaultProperties = get_class_vars($c);
52+
self::$defaultProperties[$c] = get_class_vars($c);
5353

54-
foreach ((new \ReflectionClass($c))->getProperties(\ReflectionProperty::IS_PUBLIC) as $v) {
55-
if ($v->isStatic()) {
56-
unset($defaultProperties[$v->name]);
57-
} elseif (!isset($defaultProperties[$v->name])) {
58-
$defaultProperties[$v->name] = null;
59-
}
54+
foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) {
55+
unset(self::$defaultProperties[$c][$k]);
6056
}
61-
62-
self::$defaultProperties[$c] = $defaultProperties;
6357
}
6458

6559
foreach (self::$defaultProperties[$c] as $k => $v) {

0 commit comments

Comments
 (0)