| 1 | <?php |
||
| 16 | class HandlerStack |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var Handler[] |
||
| 20 | */ |
||
| 21 | private $stack = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var HandlerContext |
||
| 25 | */ |
||
| 26 | private $context; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Constructor |
||
| 30 | * |
||
| 31 | * @param HandlerContext $context |
||
| 32 | */ |
||
| 33 | public function __construct(HandlerContext $context) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Add a handler to the stack |
||
| 40 | * |
||
| 41 | * @param Handler $handler |
||
| 42 | */ |
||
| 43 | public function push(Handler $handler) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Loop through all handlers, providing the context |
||
| 50 | */ |
||
| 51 | public function execute() |
||
| 57 | } |
||
| 58 |