These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * @copyright Copyright (c) 2014 Carsten Brandt |
||
4 | * @license https://github.com/cebe/markdown/blob/master/LICENSE |
||
5 | * @link https://github.com/cebe/markdown#readme |
||
6 | */ |
||
7 | |||
8 | namespace cebe\markdown\block; |
||
9 | |||
10 | /** |
||
11 | * Adds horizontal rules |
||
12 | */ |
||
13 | trait RuleTrait |
||
14 | { |
||
15 | /** |
||
16 | * identify a line as a horizontal rule. |
||
17 | */ |
||
18 | 199 | protected function identifyHr($line) |
|
19 | { |
||
20 | // at least 3 of -, * or _ on one line make a hr |
||
21 | 199 | return (($l = $line[0]) === ' ' || $l === '-' || $l === '*' || $l === '_') && preg_match('/^ {0,3}([\-\*_])\s*\1\s*\1(\1|\s)*$/', $line); |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * Consume a horizontal rule |
||
26 | */ |
||
27 | 28 | protected function consumeHr($lines, $current) |
|
0 ignored issues
–
show
|
|||
28 | { |
||
29 | 28 | return [['hr'], $current]; |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * Renders a horizontal rule |
||
34 | */ |
||
35 | 28 | protected function renderHr($block) |
|
0 ignored issues
–
show
|
|||
36 | { |
||
37 | 28 | return $this->html5 ? "<hr>\n" : "<hr />\n"; |
|
38 | } |
||
39 | |||
40 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.