zumba/json-serializer

`SuperClosure\SerializerInterface` is deprecated.

ping-yee opened this issue · 2 comments

Description
When I implement the readme example of Serializing Closures on PHP 8.1.12, I get this ErrorException.

SuperClosure\SerializableClosure implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)

Does it need to change the depency of SuperClosure to Opis Closure (Maybe the superClosure repo is no longer maintained) to support the closures requirement?

Thanks.

Hi @ping-yee, sorry but this issue didn't hit my radar.

Makes sense to start using Opis Closure project instead of SuperClosure. I think try to make a backward compatible version to still allow deserialization from superclosure to main the compatibility for at least 1 major version while new serializations will use Opis.

I added support to Opis Closure, but they also have the same deprecation notice. Both projects are supporting old versions of PHP, so I don't think you can make it compatible with all versions without the deprecation notice.