Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
54 | 85 | public static function getPosition($partialHtml) |
|
55 | { |
||
56 | 85 | $position = mb_strrpos(self::$allHtml, $partialHtml); |
|
57 | 85 | $parsedHtml = mb_substr(self::$allHtml, 0, $position); |
|
58 | 85 | $line = mb_substr_count($parsedHtml, "\n"); |
|
59 | 85 | if ($line === 0) { |
|
60 | return array( |
||
61 | 85 | 'line' => 0, |
|
62 | 'position' => $position |
||
63 | 85 | ); |
|
64 | } |
||
65 | |||
66 | 3 | $lastNewLinePosition = mb_strrpos($parsedHtml, "\n"); |
|
67 | |||
68 | return array( |
||
69 | 3 | 'line' => $line, |
|
70 | 3 | 'position' => mb_strlen(mb_substr($parsedHtml, $lastNewLinePosition)) |
|
71 | 3 | ); |
|
72 | } |
||
73 | } |
||
74 |