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

is_callable will always return true for objects that have __call #16

Closed
dextercampos opened this issue Apr 19, 2019 · 0 comments
Closed

Comments

@dextercampos
Copy link
Contributor

In the following lines, is_callable will return true if the object being tested has implemented __call magic method which will cause unexpected results depending on the __call implementation. I think it's better to use method_exists here rather than is_callable.

toResponseArray check:
https://github.com/loyaltycorp/apiformats/blob/6af57d9ce38817a1766252e39126f2445a631831/src/Encoders/AbstractEncoder.php#L118
getTransformer check:
https://github.com/loyaltycorp/apiformats/blob/6af57d9ce38817a1766252e39126f2445a631831/src/Encoders/JsonApiEncoder.php#L167

See PR #15 for changes with test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants