Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[RFC] Internal respondsTo() #806
It would be amazing if we could determine if a object (or static class I suppose) can respond to a method call.
For instance, in our codebase we have a filter that iterates over every piece of data the controller sends back and if they have a specific method
This could also help the
This could be useful for anything with magic methods, and I honestly wish was built into PHP.
Any thoughts on getting this into core
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I agree, this would be extremely useful, and implementation should be fairly simple.
It provides huge benefits when it comes to Entities. Not only being able to check the magic model methods, but also the instanceMethods attached to that model.