| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 17 |
| Ratio | 80.95 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 32 | protected function parseInlineCode($text) |
|
| 20 | { |
||
| 21 | 32 | View Code Duplication | if (preg_match('/^(``+)\s(.+?)\s\1/s', $text, $matches)) { // code with enclosed backtick |
| 22 | return [ |
||
| 23 | [ |
||
| 24 | 9 | 'inlineCode', |
|
| 25 | 9 | $matches[2], |
|
| 26 | ], |
||
| 27 | 9 | strlen($matches[0]) |
|
| 28 | ]; |
||
| 29 | 32 | } elseif (preg_match('/^`(.+?)`/s', $text, $matches)) { |
|
| 30 | return [ |
||
| 31 | [ |
||
| 32 | 32 | 'inlineCode', |
|
| 33 | 32 | $matches[1], |
|
| 34 | ], |
||
| 35 | 32 | strlen($matches[0]) |
|
| 36 | ]; |
||
| 37 | } |
||
| 38 | 4 | return [['text', $text[0]], 1]; |
|
| 39 | } |
||
| 40 | |||
| 46 |