Lines 100.00% 2 / 2
Methods 100.00% 2 / 2
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 handle 100.00% 1 / 1 100.00% 1 / 1 1
18class CallbackRequestHandler implements RequestHandlerInterface
19{
20    /** @var callable Invoked with (ServerRequestInterface $request): ResponseInterface */
21    private $callback;
22
23    /**
24     * @param callable $callback Invoked with (ServerRequestInterface $request): ResponseInterface
25     */
26    public function __construct(callable $callback)
27    {
28        $this->callback = $callback;
29    }
30
31    public function handle(ServerRequestInterface $request): ResponseInterface
32    {
33        return call_user_func($this->callback, $request);
34    }
35}