Closed boesing closed 3 months ago
Is it worth introducing a BC break? Will new interface that our pipe implements be sufficient?
Say,
interface InspectableMiddlewarePipeInterface extends MiddlewarePipeInterface
{
public function inspectPipedMiddleware(): array
}
Since we are releasing a major anyways, I'd say yes. Since every middleware Pipeline has a Pipeline, I think that is sufficient.
Or implement IteratorAggregate
too?
This is explicitly to inspect pipe and has nothing to do with its function. I don't think it should provide iterator.
Feature Request
Summary
I'd love to see
MiddlewarePipeInterface#getPipeline
to retrieve an iterable of middlewares to be executed. Most preferably in the same order the middlewares were actually enqueued.This method would help me to get rid of using
ReflectionProperty
in unit tests to actually grab the pipeline so that we can verify that all middlewares are actually instantiable viaContainerInterface
:More specifically the
extractMiddlewareNamesFromPipeline
method. With https://github.com/mezzio/mezzio/pull/159 it is now possible to fetch the middleware name which will be lazy-loaded byLazyLoadingMiddleware
and thus, the only thing where I would needReflectionProperty
for would be the pipeline from stratigility (well, and theroutesToInject
to accessFastRouteRouter
pending route property...).