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