<?php
interface RequestInterface {}
interface ResponseInterface {}
class Request implements RequestInterface {}
class Response implements ResponseInterface {}
interface DelegateInterface
{
/**
* Dispatch the next available middleware and return the response.
*
* @param RequestInterface $request
*
* @return ResponseInterface
*/
public function process(RequestInterface $request);
}
class Delegate implements DelegateInterface
{
public function process(RequestInterface $request): ResponseInterface
{
return new Response();
}
}
$delegate = new Delegate();
var_dump($delegate->process(new Request()));