On Fri, Jul 29, 2016 at 4:14 AM, Matthieu Napoli <[email protected]> wrote:
>
> - FrameInterface doesn't represent any actual usage or existing middlewares 
> today
> - FrameInterface is more complex than `callable`


>From Anthony's blog post
http://blog.ircmaxell.com/2016/05/all-about-middleware.html :

> The fact that $next parameter is simply a callable also suffers from the same 
> problem as above. It means that there's no longer any enforcement or ability 
> to auto-complete or check types.
>
> Instead, $next should be a formal interface which would allow for type 
> validation.

I agree with his position. Having a formal interface ensures correct
return type declarations in PHP 7. It shifts responsibility from the
user having to know what is expected to be able to have a direct type
hint that ensures accuracy.

I recommend reading the entire article, it covers a lot why PSR-15
looks like it does, and why we need PSR-17.

--
Woody Gilk
http://about.me/shadowhand

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAGOJM6%2BFSLmzDrpSA68G7uran9BBKVy5DQm98QkXrFtPBYdXww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to