| 1 | <?php |
||
| 11 | trait HandlerTrait |
||
| 12 | { |
||
| 13 | use CallableTrait; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var callable|string|null The handler used |
||
| 17 | */ |
||
| 18 | private $handler; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Constructor. |
||
| 22 | * |
||
| 23 | * @param callable|string|null $handler |
||
| 24 | */ |
||
| 25 | public function __construct($handler = null) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Set the handler. |
||
| 34 | * |
||
| 35 | * @param string|callable $handler |
||
| 36 | * |
||
| 37 | * @return self |
||
| 38 | */ |
||
| 39 | public function handler($handler) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Execute the target. |
||
| 48 | * |
||
| 49 | * @param RequestInterface $request |
||
| 50 | * @param ResponseInterface $response |
||
| 51 | * |
||
| 52 | * @return ResponseInterface |
||
| 53 | */ |
||
| 54 | private function executeHandler(RequestInterface $request, ResponseInterface $response) |
||
| 58 | } |
||
| 59 |