function Stub::__sleep
@internal
File
-
vendor/
symfony/ var-dumper/ Cloner/ Stub.php, line 50
Class
- Stub
- Represents the main properties of a PHP variable.
Namespace
Symfony\Component\VarDumper\ClonerCode
public function __sleep() : array {
$properties = [];
if (!isset(self::$defaultProperties[$c = static::class])) {
$reflection = new \ReflectionClass($c);
self::$defaultProperties[$c] = [];
foreach ($reflection->getProperties() as $p) {
if ($p->isStatic()) {
continue;
}
self::$defaultProperties[$c][$p->name] = $p->hasDefaultValue() ? $p->getDefaultValue() : ($p->hasType() ? NoDefault::NoDefault : null);
}
}
foreach (self::$defaultProperties[$c] as $k => $v) {
if (NoDefault::NoDefault === $v || $this->{$k} !== $v) {
$properties[] = $k;
}
}
return $properties;
}