I have an object which has Guzzle HTTP client (version 6) as dependency. When I try to serialize it using php serialize()
method, it throws Serialization of 'Closure' is not allowed
exception. I think of two options here:
a) to use previous version of guzzle and forget about upgrading to newer one (not the best scenario)
b) to selectively serialize object's properties, skipping the Guzzle client (it adds some complexity, but seems like the good choice)
Maybe I'm doing it all wrong, so please suggest what you would do.
UPD: the object is a model which uses Guzzle client to get it's attributes from an api.