Closed pine3ree closed 7 years ago
wouldn't it also make more sense to rename the $delegate property and parameter to $next given that the purpose of this decorator is to wrap a standard - stratigility < 1.3 - $next callable?
It may not wrap just a Next
instance; it could be a final handler or no-op final handler. In this case, it is delegating creation and return of a response.
Thanks, @pine3ree
Hello @weierophinney, wouldn't it also make more sense to rename the
$delegate
property and parameter to$next
given that the purpose of this decorator is to wrap a standard - stratigility < 1.3 - $next callable? I visually (and mentally) tend to associate the$delegate
job with$delegate->process($req)
calls and old$next
callables job with$next($req, $res)
calls. Of course it's a mere matter of names. In this case the decorator "decorates the callable" by "adding" its own process() method with a proxy invocation of $next.kind regards