| 1 | <?php |
||
| 14 | abstract class AbstractRestAction implements MiddlewareInterface, RequestMethodInterface, StatusCodeInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var LoggerInterface |
||
| 18 | */ |
||
| 19 | protected $logger; |
||
| 20 | |||
| 21 | 20 | public function __construct(LoggerInterface $logger = null) |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Process an incoming server request and return a response, optionally delegating |
||
| 28 | * to the next middleware component to create the response. |
||
| 29 | * |
||
| 30 | * @param Request $request |
||
| 31 | * @param DelegateInterface $delegate |
||
| 32 | * |
||
| 33 | * @return Response |
||
| 34 | */ |
||
| 35 | 20 | public function process(Request $request, DelegateInterface $delegate) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @param Request $request |
||
| 46 | * @param DelegateInterface $delegate |
||
| 47 | * @return null|Response |
||
| 48 | */ |
||
| 49 | abstract protected function dispatch(Request $request, DelegateInterface $delegate); |
||
| 50 | } |
||
| 51 |