Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
36 | 3 | public function goBeforeCharacter(\SplFileObject $file, $characterNumber) |
|
37 | { |
||
38 | 3 | $file->rewind(); |
|
39 | |||
40 | 3 | if ($characterNumber < 0 || $characterNumber > $file->getSize()) { |
|
41 | 2 | throw new OutOfBoundsException(); |
|
42 | } |
||
43 | |||
44 | 1 | for ($i = 0; $i <= $characterNumber - 1; $i++) { |
|
45 | 1 | $file->fgetc(); |
|
46 | 1 | } |
|
47 | |||
48 | 1 | return $file; |
|
49 | } |
||
50 | |||
70 |