Skip to content

Commit

Permalink
Implement __serialize to avoid deprecation warning on php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosp committed Jan 12, 2024
1 parent b59dbb8 commit 0589070
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Event/SerializableEventTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ trait SerializableEventTrait
*/
public function serialize()
{
return serialize(get_object_vars($this));
return serialize($this->__serialize());
}

/**
* @return array<string,mixed>
*/
public function __serialize()
{
return get_object_vars($this);
}

/**
Expand Down

0 comments on commit 0589070

Please sign in to comment.