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 | 2 | public function get(): PromiseInterface |
|
52 | { |
||
53 | 2 | if (count($this->queue) === 0 && $this->done === true) { |
|
54 | 1 | return resolve(); |
|
55 | } |
||
56 | |||
57 | 2 | if (count($this->queue) === 0) { |
|
58 | 1 | $this->deferred = new Deferred(); |
|
59 | |||
60 | 1 | return $this->deferred->promise(); |
|
61 | } |
||
62 | |||
63 | 1 | return resolve(array_shift($this->queue)); |
|
64 | } |
||
65 | } |
||
66 |