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