Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Remove ArrayBuilderInterface ? #4

Open
chriskoch opened this issue Oct 27, 2013 · 1 comment
Open

Remove ArrayBuilderInterface ? #4

chriskoch opened this issue Oct 27, 2013 · 1 comment
Assignees
Labels

Comments

@chriskoch
Copy link
Contributor

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?

@ghost ghost assigned tdeekens Oct 27, 2013
@tdeekens
Copy link
Contributor

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 free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants