laminas / laminas-httphandlerrunner

Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.
https://docs.laminas.dev/laminas-httphandlerrunner/
BSD 3-Clause "New" or "Revised" License
63 stars 20 forks source link

Drop require for psr-7 message implementation #46

Closed Xerkus closed 1 year ago

Xerkus commented 1 year ago
Q A
Documentation no
Bugfix no
BC Break no
New Feature no
RFC no
QA yes

Description

Dependency on PSR-7 message implementation meta-package is superfluous. If no implementation provided this package will not be in incomplete state.

weierophinney commented 1 year ago

@Xerkus I completely disagree.

When we depend on an implementation package, it provides a signal to the person installing/requiring it that they need addiitional dependencies in order to consume it. They then get the error when attempting to install this package, instead of when testing or attempting to run the application that uses the package. The latter is much harder to diagnose, and is completely prevented by having the requirement on an implementation package.

I'm going to remove the milestone from this so we can discuss further before making a final decision.

Xerkus commented 1 year ago

My reasoning here is that nothing creates requests or responses, there is no functionality that indirectly depends on implementation actually being present.

What happens if no implementation is present? Nothing. If there is no response provided by something else then this package has nothing to do.

Same with other middleware components. It might depend on response factory to create response but unless something else provided request. With no request object provided by something else the component is simply not used.

Case in point: we do not require implementation to be provided for mezzio-helpers: https://github.com/mezzio/mezzio-helpers/blob/5.16.x/composer.json#L37 No not for mezzio-router https://github.com/mezzio/mezzio-router/blob/3.17.x/composer.json#L37

Requiring implementation only makes sense for mezzio or http runner... waaait a second. I did this on a wrong terminal window in wrong repo and did not realize since I used gh cli to create PR as well.