Total Complexity | 3 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class Chain |
||
17 | { |
||
18 | /** |
||
19 | * @var array<callable> |
||
20 | */ |
||
21 | private array $chain; |
||
22 | |||
23 | /** |
||
24 | * Constructor |
||
25 | * |
||
26 | * @param array<callable> $chained_callable |
||
27 | */ |
||
28 | public function __construct(array $chained_callable = []) |
||
29 | { |
||
30 | $this->chain = $chained_callable; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Take the first callable in the chain, remove it from que and call it, returning it's result |
||
35 | * |
||
36 | * @param Request $request |
||
37 | * @return null|Response |
||
38 | */ |
||
39 | public function next(Request $request): ?Response |
||
46 | } |
||
47 | } |
||
48 |