| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 51 | 3 | public function get(): PromiseInterface |
|
| 52 | { |
||
| 53 | 3 | if (\count($this->queue) === 0 && $this->done === true) { |
|
| 54 | 1 | return resolve(); |
|
| 55 | } |
||
| 56 | |||
| 57 | 3 | if (\count($this->queue) === 0) { |
|
| 58 | 2 | $this->deferred = new Deferred(); |
|
| 59 | |||
| 60 | 2 | return $this->deferred->promise(); |
|
| 61 | } |
||
| 62 | |||
| 63 | 1 | return resolve(\array_shift($this->queue)); |
|
| 64 | } |
||
| 65 | } |
||
| 66 |