ghostzero / tmi

PHP Twitch Messaging Interface
MIT License
24 stars 8 forks source link

Cannot serialize event due client #9

Closed ghostzero closed 2 years ago

ghostzero commented 3 years ago

How to reproduce:

  1. Create a new tmi.php client.
  2. Recive an event via the tmi client.
  3. Serialize the given event.
  4. Error, because the serializer tries to serialize the $client property (which is a socket).

https://github.com/ghostzero/tmi/blob/c2c34aecfa4968784db7ac57346e22d578109e21/src/Events/Event.php#L12

ghostzero commented 2 years ago

For the records: Customer just serialize/unserialize the events before putting them into the queue. It would be awesome if tmi just serialize the classes by it's own. Eg. ignore the client in serialization, but then you cannot access client after unserialize 🤔

Hmm, complicated. It would be better to just remove client from the events.

ghostzero commented 2 years ago

Fixed in release 2.3.1.