Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class HandlerStack implements HandlerStackContract |
||
11 | { |
||
12 | /** |
||
13 | * Stores the handlers in the stack |
||
14 | * |
||
15 | * @var HandlerContract[]|ArtisanHandler[] |
||
16 | */ |
||
17 | protected array $stack = []; |
||
18 | |||
19 | /** |
||
20 | * @inheritDoc |
||
21 | */ |
||
22 | 8 | public function push(HandlerContract|ArtisanHandler $handler): HandlerStackContract |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * @inheritDoc |
||
30 | */ |
||
31 | 11 | public function empty(): bool |
|
32 | { |
||
33 | 11 | return empty($this->stack); |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @inheritDoc |
||
38 | */ |
||
39 | 6 | public function current(): HandlerContract|ArtisanHandler|bool |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * @inheritDoc |
||
46 | */ |
||
47 | 6 | public function next(): HandlerContract|ArtisanHandler|bool |
|
48 | { |
||
49 | 6 | return next($this->stack); |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @inheritDoc |
||
54 | */ |
||
55 | 8 | public function reset(): void |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * @inheritDoc |
||
62 | */ |
||
63 | 1 | public function flush(): HandlerStackContract |
|
68 | } |
||
69 | |||
70 | } |
||
71 |