Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.1406 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
83 | 23 | public function readString($length) |
|
84 | { |
||
85 | 23 | if (!$length) { |
|
86 | $result = ''; |
||
87 | 23 | } elseif ($this->position + $length > $this->length) { |
|
88 | throw new Exception('Read after end-of-string'); |
||
89 | } else { |
||
90 | 23 | $result = substr($this->string, $this->position, $length); |
|
91 | 23 | $this->position += $length; |
|
92 | } |
||
93 | |||
94 | 23 | return $result; |
|
95 | } |
||
96 | } |
||
97 |