http-interop / http-middleware

PSR-15 interfaces for HTTP Middleware
MIT License
73 stars 7 forks source link

Remove misplaced/superfluous compatibility argument. #58

Closed schnittstabil closed 7 years ago

schnittstabil commented 7 years ago

For clarity:

 ### 5.2 Delegate Design
 …
 #### Why isn't the delegate a `callable`?

 Using an interface type hint improves runtime safety and IDE support.

-In addition, it allows compatibility with existing middleware that already defines
-an `__invoke` method.

Obviously, this sentence is off-topic, it is neither about delegates nor callable. It may support the _Why doesn't middleware use __invoke?_ reasons, but if we rewrite and move it there, it would be superfluous: that section already contains the compatibility argument:

Why doesn't middleware use __invoke?

Doing so would conflict with existing middleware that implements the double-pass approach and may want to implement the middleware interface.

Therefore, I suggest to simply remove it.

shadowhand commented 7 years ago

This is effectively the same as #55 and #56

schnittstabil commented 7 years ago

This is effectively the same as #55 and #56

No, it's not! The issue here is, that the sentence is off-topic, isn't it? – It is neither about delegates nor callable.

shadowhand commented 7 years ago

You're right, this statement doesn't make sense in this context, since a delegate cannot be a middleware.