On 12-02-02 09:24 PM, Hannes Magnusson wrote:
I don't think its as simple as that. You still need to document the params, return values and stuff, which can often be whole lot of info. How would http://no2.php.net/manual/en/function.session-set-save-handler.php for example become?
I'd have that reference as it is, but simply include the prototypes. This doesn't have to be immediately perfect and over-engineered. It's simply a refactoring of the existing way of doing it, which is to try to describe the callback function structure using written text; and that's extremely confusing.
We have in somecases simply documented the callback as a "real" function, like http://no.php.net/manual/en/function.stream-notification-callback.php I think I am more fan of that approach.
That makes sense in very complicated instances, where a lot of documentation supplementary to the prototype is needed. My suggestion for callback prototypes really only applies to functions such as array_reduce(), which doesn't require a lot of explanation.
Thanks, Justin Martin