Create Mezzio\ApplicationPipeline
implementation for better static code analysis
#105
Labels
Won't Fix
This will not be worked on
Feature Request
Summary
In this package,
Mezzio\ApplicationPipeline
is a service identifier to retrieve the assembled middleware pipeline for a mezzio project which does not actually represents a class.This pipeline is consumed by these classes in a mezzio project:
mezzio/src/Application.php
Line 33 in 24bfca0
That pipeline gets assembled in:
mezzio/src/Container/ApplicationPipelineFactory.php
Line 15 in 24bfca0
And registered in:
mezzio/src/ConfigProvider.php
Line 54 in 24bfca0
Retrieving this pipeline via a PSR-11 is quite annoying due to the fact that neither an IDE is able to auto-complete the typed service name nor a static-analysis tool is able to understand what is happening.
My suggestion would be to create a class called
ApplicationPipeline
which implementsMiddlewarePipeInterface
(which implements bothRequestHandlerInterface
andMiddlewareInterface
) and thus allow factories to retrieve that pipeline via:Mezzio\ApplicationPipeline
class-stringPsr\Http\Server\RequestHandlerInterface
class-string (alias toMezzio\ApplicationPipeline
)This would allow us to properly fetch the application pipeline from within the
ApplicationFactory
and theRequestHandlerRunnerFactory
:mezzio/src/Container/ApplicationFactory.php
Line 33 in 24bfca0
mezzio/src/Container/RequestHandlerRunnerFactory.php
Line 35 in 24bfca0
The text was updated successfully, but these errors were encountered: