for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace mindplay\middleman;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
/**
* PSR-15 delegate wrapper for internal callbacks generated by {@see Dispatcher} during dispatch.
*
* @internal
*/
class Delegate implements RequestHandlerInterface
{
* @var callable
private $callback;
* @param callable $callback function (RequestInterface $request) : ResponseInterface
public function __construct(callable $callback)
$this->callback = $callback;
}
* Dispatch the next available middleware and return the response.
* @param ServerRequestInterface $request
* @return ResponseInterface
public function handle(ServerRequestInterface $request): ResponseInterface
return ($this->callback)($request);
* This method duplicates `handle()` to provide support for `callable` middleware.
public function __invoke(ServerRequestInterface $request)