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

[3.0]MiddlewarePipe marked as `final` #144

Closed michalbundyra closed 6 years ago

michalbundyra commented 6 years ago

On release-3.0.0 branch MiddlewarePipe is marked as final.

I have couple concerns about it, mainly the problem could be with testing, because we are not providing abstraction for the public interface. More I've wrote on discourse: https://discourse.zendframework.com/t/rfc-expressive-3-design-changes/438/6

As discussed with @weierophinney on slack probably we should remove final or provide interface.

/cc @snapshotpl @danizord @xtreamwayz @weierophinney

danizord commented 6 years ago

👍 for MiddlewarePipeInterface :)

weierophinney commented 6 years ago

One thing to note: we still will not extend MiddlewarePipe, nor implement any such interface, within zend-expressive, due to the difference in signature requirements (Expressive will likely continue to allow at the very least either MiddlewareInterface instances or string service names, and potentially also arrays of these.)

So, this will not affect Expressive in any way, but the point is that we should only have a final visibility if all API methods are available in an interface somewhere; otherwise, we should drop the visibility.

weierophinney commented 6 years ago

Let's go with MiddlewarePipeInterface with the single method pipe(MiddlewareInterface $middleware) : void. Mocking this will be trivial, and we then only need to alter MiddlewarePipe to implement that interface.

weierophinney commented 6 years ago

Closed with #146