| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3.0884 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 2 | public function wait($waitAble){ |
|
| 38 | 2 | array_push($this->waits, $waitAble); |
|
| 39 | 2 | $this->run(); |
|
| 40 | |||
| 41 | 2 | if(count($this->waits)){ |
|
| 42 | 2 | $waitAll = $this->waitAll; |
|
| 43 | 2 | $this->waitResults = $waitAll($this->waits); |
|
| 44 | 2 | $this->waits = []; |
|
| 45 | 2 | } |
|
| 46 | |||
| 47 | 2 | $res = array_pop($this->waitResults); |
|
| 48 | 2 | if(isset($res[1])){ |
|
| 49 | \PhpBoot\abort(new RpcException($res['reason'])); |
||
| 50 | }else{ |
||
| 51 | 2 | return $res[0]; |
|
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 83 | } |