diff --git a/src/ClassReflection.php b/src/ClassReflection.php index e192ef9..0d3525c 100644 --- a/src/ClassReflection.php +++ b/src/ClassReflection.php @@ -602,6 +602,13 @@ public function __serialize(): array return $vars; } + public function __unserialize(array $data): void + { + foreach ($data as $name => $value) { + $this->{$name} = $value; + } + } + public function __clone() { if ((debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['class'] ?? null) !== self::class) { diff --git a/src/MethodReflection.php b/src/MethodReflection.php index c7f6d8f..72795ef 100644 --- a/src/MethodReflection.php +++ b/src/MethodReflection.php @@ -362,6 +362,13 @@ public function __serialize(): array return $data; } + public function __unserialize(array $data): void + { + foreach ($data as $name => $value) { + $this->{$name} = $value; + } + } + public function __clone() { if ((debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['class'] ?? null) !== self::class) { diff --git a/src/ParameterReflection.php b/src/ParameterReflection.php index 0ff0655..3d21232 100644 --- a/src/ParameterReflection.php +++ b/src/ParameterReflection.php @@ -107,6 +107,13 @@ public function __serialize(): array return $data; } + public function __unserialize(array $data): void + { + foreach ($data as $name => $value) { + $this->{$name} = $value; + } + } + /** * @return ?positive-int */ diff --git a/src/PropertyReflection.php b/src/PropertyReflection.php index 60a7e2e..b929fde 100644 --- a/src/PropertyReflection.php +++ b/src/PropertyReflection.php @@ -161,6 +161,13 @@ public function __serialize(): array return $data; } + public function __unserialize(array $data): void + { + foreach ($data as $name => $value) { + $this->{$name} = $value; + } + } + public function __clone() { if ((debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['class'] ?? null) !== self::class) {