| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 1 | private function getLineNumber(): int |
|
| 43 | { |
||
| 44 | 1 | $pos = $this->stringIterator->key(); |
|
| 45 | 1 | $this->stringIterator->rewind(); |
|
| 46 | 1 | $lineNo = 1; |
|
| 47 | |||
| 48 | 1 | while ($this->stringIterator->key() < $pos) { |
|
| 49 | 1 | if ($this->stringIterator->is(Tokens::LINE_FEED)) { |
|
| 50 | 1 | ++$lineNo; |
|
| 51 | } |
||
| 52 | 1 | $this->stringIterator->next(); |
|
| 53 | } |
||
| 54 | |||
| 55 | 1 | return $lineNo; |
|
| 56 | } |
||
| 58 |