Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 11 |
Ratio | 100 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | 1 | View Code Duplication | public static function findFirstPositionInCurrentLine(PHP_CodeSniffer_File $file, int $position) : int |
19 | { |
||
20 | 1 | $currentPosition = $position; |
|
21 | |||
22 | 1 | $line = $file->getTokens()[$position]['line']; |
|
23 | 1 | while ($file->getTokens()[$currentPosition]['line'] === $line) { |
|
24 | 1 | $currentPosition--; |
|
25 | } |
||
26 | |||
27 | 1 | return $currentPosition; |
|
28 | } |
||
29 | |||
44 |