The Middleware Container

While the skeleton creates a general PSR-11 container in which to map all of your dependencies, this can pose problems when you are attempting to pull middleware and request handlers; you could potentially, accidentally, pull something of an entire type entirely, which may not work in either context!

To prevent this from happening, we provide Zend\Expressive\MiddlewareContainer. It decorates your application container, and adds the following behavior:

Internally, this class is used by the MiddlewareFactory and the Zend\Expressive\Middleware\LazyLoadingMiddleware class; you should never need to interact with it directly, unless the above features are of interest to you.