feat: API transformers#9763
Conversation
e655300 to
10796a6
Compare
michalsn
left a comment
There was a problem hiding this comment.
Not sure about the when / whenNot methods - they don't seem to bring much value, since they're basically just short if statement replacements. They could also be confusing at first glance because of our ConditionalTrait. But that might just be a first impression.
Seems like Deptrac rules have to be updated.
Overall, this seems like a really useful feature for people who work with APIs often.
No, you're right I think. It's mainly syntactic sugar and not really necessary. I'll remove them for now. I even looked at our ConditionalTrait to see if we could use it and it wouldn't work nicely so it's probably just confusing. Thanks. |
paulbalandan
left a comment
There was a problem hiding this comment.
Just reviewed on phone. I'll review again later but here are some comments.
Description
Adds API Transformers to CodeIgniter. This helps enforce best practices of never providing your entire object's values to the API. Instead, you would use a Transformer to build the API's response objects. This also allows:
Checklist: