You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@johnbillion I've done a full review of the Hooks documentation today, with PR #646 as a result. While this doesn't change the way the hook is being dispatched, it does update the documentation to be more informative regarding this.
If you have the time, would be great if you could look the PR over and give your opinion.
Hmm, still on the fence about this one, as I'm not yet sure whether the documentation for the optional $info args is sufficient here. It might be more robust to go with @johnbillion's suggestion and provide an $info array in all cases, with an empty one being used for non-blocking requests. I'll think about this some more...
Deciding whether or not to always pass $info is a different issue and if/when it is so decided, the documentation can be further updated to reflect that change.
Generally speaking I'm in favour of John's suggestion and would recommend for hooks to have the same number of arguments every time they are called, however, making this change now could be considered a breaking change as functions which "hook in" very likely will need updating (callbacks may have a different default value set - null - for the optional parameter from the empty array we would pass, callbacks may use isset() on the result of function_get_args() for this parameter, which would break, etc).
The
fsockopen.after_request
andcurl.after_request
hooks don't receive an$info
parameter when a non-blocking request is sent.This means the hook signature differs depending on whether the request is blocking or not, and conflicts with the hook docs.
Possible solution: Pass an empty array as the
$info
parameter for these hooks when a non-blocking request is performed.Since #206.
The text was updated successfully, but these errors were encountered: