Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert snake case setters to camel case. #29

Closed
wants to merge 2 commits into from

Conversation

mateusrevoredo
Copy link
Contributor

Changing the way library was looking for setter methods.
Previously it was concatenating 'set' with ucfirst($name). This way, if the incoming json had an attribute written in snake case like "number_of_comments", it'd look for a method called setNumber_of_comments, which does not follow the PSR-1 convention.
With this change, it now converts the name of the json attribute to camel case, and looks for the correct setter method.

@mateusrevoredo
Copy link
Contributor Author

Closing this one because it doesn't meet PEAR standards

@cweiske
Copy link
Owner

cweiske commented Mar 31, 2015

You can still use __set() and follow PSR-1.

cweiske pushed a commit that referenced this pull request Jan 21, 2023
…ble name

This lets us add e.g. camel case mapping handlers.

Resolves: #198
Resolves: #183
Resolves: #150
Resolves: #149
Resolves: #29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants