Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
29 | protected function read($length) { |
||
30 | while($this->dataLength < $this->offset + $length){ |
||
31 | if ($this->source === null) |
||
32 | throw new Exception('The response is incomplete, or types expectation mismatch.'); |
||
33 | |||
34 | $this->data .= $received = $this->source->readOnce($this->offset + $length - $this->dataLength); |
||
35 | $this->dataLength += strlen($received); |
||
36 | } |
||
37 | |||
38 | $output = substr($this->data, $this->offset, $length); |
||
39 | $this->offset += $length; |
||
40 | return $output; |
||
41 | } |
||
42 | } |
||
43 |