You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 27, 2022. It is now read-only.
Controller::renderJson() uses as an optional param a instance of ArrayBuilderInterface. The idea behind was that you can convert complex objects to an assoc. array. We can remove all corresponding code if we check against JsonSerializable interface instead:
Opinions?
The text was updated successfully, but these errors were encountered:
Feels like this almost only boils down to personal taste. I am don't really like passing interfaces around as method params. I think you could also go for a more functional way by just stating that an object can have a ->toJSON() which will be called in that case. A bit like the backbone's way of using parse and toJSON too.
Or just stating that the object has to be implementing a lmvc-jsonifyinterface with that method, if you want to trade method existence for instance checks.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Controller::renderJson() uses as an optional param a instance of ArrayBuilderInterface. The idea behind was that you can convert complex objects to an assoc. array. We can remove all corresponding code if we check against JsonSerializable interface instead:
Opinions?
The text was updated successfully, but these errors were encountered: