| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 40 | public function subscribe(ObserverInterface $observer, SchedulerInterface $scheduler = null): DisposableInterface |
||
| 41 | { |
||
| 42 | $body = $this->response->getBody(); |
||
| 43 | $body->on('data', function (string $data) use ($observer) { |
||
| 44 | $observer->onNext($data); |
||
| 45 | }); |
||
| 46 | $body->on('end', function () use ($observer) { |
||
| 47 | $observer->onCompleted(); |
||
| 48 | }); |
||
| 49 | $body->on('error', function ($error) use ($observer) { |
||
| 50 | $observer->onError($error); |
||
| 51 | }); |
||
| 52 | |||
| 53 | return new EmptyDisposable(); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |