| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 11 | public function read($length, $blocking = true) |
|
| 47 | { |
||
| 48 | 11 | if (strlen($this->readBuffer) < $length) { |
|
| 49 | 11 | $length = strlen($this->readBuffer); |
|
| 50 | 11 | } |
|
| 51 | |||
| 52 | 11 | $data = substr($this->readBuffer, 0, $length); |
|
| 53 | 11 | $this->readBuffer = substr($this->readBuffer, $length, strlen($this->readBuffer) - $length); |
|
| 54 | |||
| 55 | 11 | return $data; |
|
| 56 | } |
||
| 57 | |||
| 98 |