Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 0 |
1 | <?php |
||
35 | 1 | private function getLineNumber(): int |
|
36 | { |
||
37 | 1 | $pos = $this->stringIterator->key(); |
|
38 | 1 | $this->stringIterator->rewind(); |
|
39 | 1 | $lineNo = 1; |
|
40 | |||
41 | 1 | while ($this->stringIterator->key() < $pos) { |
|
42 | 1 | if (AsciiChar::LINE_FEED === $this->stringIterator->ord()) { |
|
43 | ++$lineNo; |
||
44 | } |
||
45 | 1 | $this->stringIterator->next(); |
|
46 | } |
||
47 | |||
48 | 1 | return $lineNo; |
|
49 | } |
||
51 |