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