Total Complexity | 4 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php # -*- coding: utf-8 -*- |
||
6 | class GithubPre extends AbstractRegexRule |
||
7 | { |
||
8 | |||
9 | /** |
||
10 | * Get the regex rule to identify the fromFile for the callback. |
||
11 | * Code blocks via 3 ` include language string (optional). |
||
12 | * |
||
13 | * @return string |
||
14 | */ |
||
15 | 8 | public function rule(): string |
|
16 | 8 | { |
|
17 | 8 | return '#(^|\n)([`~]{3,})(?: *\.?([a-zA-Z0-9\-.]+))?\n+([\s\S]+?)\n+\2(\n|$)#'; |
|
18 | } |
||
19 | |||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | 5 | public function render(array $content): string |
|
32 | } |
||
33 | } |
||
34 |