| Total Complexity | 3 |
| Total Lines | 29 |
| 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 | protected bool $useEvents = false; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Enable events in pipeline. |
||
| 16 | */ |
||
| 17 | 5 | public function withEvents(): static |
|
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Fire the event if enabled. |
||
| 26 | * |
||
| 27 | * @param mixed ...$params |
||
| 28 | */ |
||
| 29 | 31 | protected function fireEvent(string $event, ...$params): void |
|
| 38 |