1 | <?php |
||
18 | trait ProgressStateProviderMethods |
||
19 | { |
||
20 | /** @var ProgressStateListener[] */ |
||
21 | protected $listeners = []; |
||
22 | |||
23 | /** |
||
24 | * Registers a projectionist state listener |
||
25 | * |
||
26 | * @param $listener |
||
27 | * |
||
28 | * @return ProgressStateProvider|self|$this |
||
29 | */ |
||
30 | public function register($listener): ProgressStateProvider |
||
35 | |||
36 | /** |
||
37 | * Notify listeners of progress max steps |
||
38 | * |
||
39 | * @param int $max |
||
40 | */ |
||
41 | protected function notifyMaxSteps(int $max): void |
||
47 | |||
48 | /** |
||
49 | * Notify listeners of progress advanced steps |
||
50 | * |
||
51 | * @param int $steps |
||
52 | */ |
||
53 | protected function notifyAdvance(int $steps = 1): void |
||
59 | |||
60 | /** |
||
61 | * Notify listeners of progress finish |
||
62 | */ |
||
63 | protected function notifyFinish(): void |
||
69 | |||
70 | /** |
||
71 | * Notify listeners of handled vents |
||
72 | * |
||
73 | * @param int $processed |
||
74 | */ |
||
75 | protected function notifyHandledEvent(int $processed = 1): void |
||
81 | } |
||
82 |