Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/var-dumper/Cloner/Stub.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
37 public $handle = 0; | 37 public $handle = 0; |
38 public $refCount = 0; | 38 public $refCount = 0; |
39 public $position = 0; | 39 public $position = 0; |
40 public $attr = []; | 40 public $attr = []; |
41 | 41 |
42 private static $defaultProperties = []; | |
43 | |
42 /** | 44 /** |
43 * @internal | 45 * @internal |
44 */ | 46 */ |
45 public function __sleep() | 47 public function __sleep() |
46 { | 48 { |
47 $this->serialized = [$this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr]; | 49 $properties = []; |
48 | 50 |
49 return ['serialized']; | 51 if (!isset(self::$defaultProperties[$c = \get_class($this)])) { |
50 } | 52 self::$defaultProperties[$c] = get_class_vars($c); |
51 | 53 |
52 /** | 54 foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) { |
53 * @internal | 55 unset(self::$defaultProperties[$c][$k]); |
54 */ | 56 } |
55 public function __wakeup() | 57 } |
56 { | 58 |
57 list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = $this->serialized; | 59 foreach (self::$defaultProperties[$c] as $k => $v) { |
58 unset($this->serialized); | 60 if ($this->$k !== $v) { |
61 $properties[] = $k; | |
62 } | |
63 } | |
64 | |
65 return $properties; | |
59 } | 66 } |
60 } | 67 } |