Total Complexity | 4 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
7 | trait HasEvents |
||
8 | { |
||
9 | /** |
||
10 | * Determines whether pipeline uses events. |
||
11 | * |
||
12 | * @var bool |
||
13 | */ |
||
14 | protected bool $useEvents = false; |
||
15 | |||
16 | /** |
||
17 | * Enable events in pipeline. |
||
18 | * |
||
19 | * @return static |
||
20 | */ |
||
21 | 3 | public function withEvents(): static |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * Fire the event if enabled. |
||
30 | * |
||
31 | * @param string $event |
||
32 | * @param string|callable|mixed $pipe |
||
33 | * @param mixed $passable |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | 25 | protected function fireEvent(string $event, $pipe, $passable): void |
|
51 |