| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.1481 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 30 | public function __construct(ObservableInterface $observable) |
||
| 31 | { |
||
| 32 | 1 | $observable->subscribe(function ($item) { |
|
| 33 | 1 | if ($this->deferred instanceof Deferred) { |
|
| 34 | $this->deferred->resolve($item); |
||
| 35 | $this->deferred = null; |
||
| 36 | |||
| 37 | return; |
||
| 38 | } |
||
| 39 | |||
| 40 | 1 | $this->queue[] = $item; |
|
| 41 | }, null, function () { |
||
| 42 | 1 | $this->done = true; |
|
| 43 | 1 | }); |
|
| 44 | 1 | } |
|
| 45 | |||
| 61 |