for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Chubbyphp\SlimPsr15;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
final class MiddlewareRequestHandlerAdapter implements RequestHandlerInterface
{
/**
* @var ResponseInterface
*/
private $response;
* @var callable
private $next;
public function __construct(ResponseInterface $response, callable $next)
$this->response = $response;
$this->next = $next;
}
public function handle(ServerRequestInterface $request): ResponseInterface
$next = $this->next;
return $next($request, $this->response);