Skip to content

Commit

Permalink
πŸ› unserialize must be void
Browse files Browse the repository at this point in the history
  • Loading branch information
willpower232 committed Jan 18, 2025
1 parent 559b391 commit d9db3b8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Events/DispatchAudit.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __serialize()
foreach ($customProperties as $key) {
try {
$values['model_data'][$key] = $this->getModelPropertyValue($reflection, $key);
} catch (\Throwable $e){
} catch (\Throwable $e) {
//
}
}
Expand All @@ -67,19 +67,16 @@ public function __serialize()
/**
* Restore the model after serialization.
*
* @param array $values
* @return array
* @param array<string,mixed> $values
*/
public function __unserialize(array $values)
public function __unserialize(array $values): void
{
$this->model = new $values['class'];

$reflection = new ReflectionClass($this->model);
foreach ($values['model_data'] as $key => $value) {
$this->setModelPropertyValue($reflection, $key, $value);
}

return $values;
}

/**
Expand Down

0 comments on commit d9db3b8

Please sign in to comment.