Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | class LazyHandler implements RequestHandlerInterface |
||
13 | { |
||
14 | /** @var ContainerInterface */ |
||
15 | private $container; |
||
16 | |||
17 | /** @var string */ |
||
18 | private $handler; |
||
19 | |||
20 | 3 | public function __construct(ContainerInterface $container, string $handler) |
|
21 | { |
||
22 | 3 | if (! is_subclass_of($handler, RequestHandlerInterface::class, true)) { |
|
23 | 1 | throw new InvalidArgumentException( |
|
24 | 1 | sprintf('%s does not implement %s', $handler, RequestHandlerInterface::class) |
|
25 | ); |
||
26 | } |
||
27 | |||
28 | 2 | $this->container = $container; |
|
29 | 2 | $this->handler = $handler; |
|
30 | 2 | } |
|
31 | |||
32 | // RequestHandlerInterface |
||
33 | 1 | public function handle(ServerRequestInterface $request): ResponseInterface |
|
36 | } |
||
37 | |||
38 | 1 | private function resolve(): RequestHandlerInterface |
|
43 |