Conditions | 3 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
16 | public function parse() |
||
17 | { |
||
18 | $bytes = (int) $this->data; |
||
19 | if ($bytes < 0) { |
||
20 | return null; |
||
21 | } |
||
22 | |||
23 | $bytes += 2; // CRLF |
||
24 | $string = ''; |
||
25 | |||
26 | do { |
||
27 | $buffer = $this->read($bytes); |
||
28 | $string .= $buffer; |
||
29 | $bytes -= strlen($buffer); |
||
30 | } while ($bytes > 0); |
||
31 | |||
32 | return substr($string, 0, -2); // Remove last CRLF |
||
33 | } |
||
34 | |||
50 | } |