PHPackages                             ellipse/handlers-container - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. ellipse/handlers-container

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

ellipse/handlers-container
==========================

Psr-15 request handler proxying a Psr-11 container entry

1.0.3(8y ago)0801MITPHPPHP &gt;=7.0

Since Mar 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ellipsephp/handlers-container)[ Packagist](https://packagist.org/packages/ellipse/handlers-container)[ Docs](https://github.com/ellipsephp/handlers-container)[ RSS](/packages/ellipse-handlers-container/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (5)Used By (1)

Request handler container
=========================

[](#request-handler-container)

This package provides a [Psr-15](https://www.php-fig.org/psr/psr-15/) request handler proxying a [Psr-11](https://www.php-fig.org/psr/psr-11/) container entry.

**Require** php &gt;= 7.0

**Installation** `composer require ellipse/handlers-container`

**Run tests** `./vendor/bin/kahlan`

- [Using container entries as request handlers](#using-container-entries-as-request-handlers)
- [Example using auto wiring](#example-using-auto-wiring)

Using container entries as request handlers
-------------------------------------------

[](#using-container-entries-as-request-handlers)

The class `Ellipse\Handlers\ContainerRequestHandler` takes an implementation of `Psr\Container\ContainerInterface` and a container id as parameters. Its `->handle()` method retrieve a request handler from the container using this id and proxy its `->handle()` method.

It can be useful in situations the container entry should be resolved at the time the request is handled.

An `Ellipse\Handlers\Exceptions\ContainedRequestHandlerTypeException` is thrown when the value retrieved from the container is not an object implementing `Psr\Http\Server\RequestHandlerInterface`.

```
