| Conditions | 4 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function result(): EntityInterface |
||
| 32 | { |
||
| 33 | $stream = $this->response->getBody(); |
||
| 34 | $streamed = []; |
||
| 35 | if ($stream instanceof Stream) { |
||
| 36 | while (!$stream->eof()) { |
||
| 37 | $line = trim(\GuzzleHttp\Psr7\readline($stream)); |
||
| 38 | if (!empty($line)) { |
||
| 39 | $decode = \GuzzleHttp\json_decode($line, true); |
||
| 40 | $row = new StreamedRow($decode['row']); |
||
| 41 | call_user_func_array($this->callback, [$row]); |
||
| 42 | $streamed[] = $row; |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | return new StreamedRows($streamed); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |