zendframework / zend-stratigility

Middleware for PHP built on top of PSR-7 and PSR-15
BSD 3-Clause "New" or "Revised" License
235 stars 57 forks source link

doc-block typo #93

Closed pine3ree closed 7 years ago

pine3ree commented 7 years ago

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

weierophinney commented 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.

weierophinney commented 7 years ago

Thanks, @pine3ree