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