Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
15 | class Waited |
||
16 | { |
||
17 | /** |
||
18 | * @var mixed[] |
||
19 | */ |
||
20 | private $chain = []; |
||
21 | |||
22 | /** |
||
23 | * @var Promised |
||
24 | */ |
||
25 | private $done = null; |
||
26 | |||
27 | /** |
||
28 | * @param mixed[] $programs |
||
29 | */ |
||
30 | public function add(...$programs) : void |
||
31 | { |
||
32 | $this->chain = array_merge($this->chain, $programs); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return Promised |
||
37 | */ |
||
38 | public function done() : Promised |
||
39 | { |
||
40 | return $this->done ?? $this->done = Promise::deferred(); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return Promised |
||
45 | */ |
||
46 | public function perform() : Promised |
||
49 | } |
||
50 | } |
||
51 |