1 | <?php |
||
22 | class GithubMarkdown extends Markdown |
||
23 | { |
||
24 | // include block element parsing using traits |
||
25 | use TableTrait; |
||
26 | use FencedCodeTrait; |
||
27 | |||
28 | // include inline element parsing using traits |
||
29 | use StrikeoutTrait; |
||
30 | use UrlLinkTrait; |
||
31 | |||
32 | /** |
||
33 | * @var boolean whether to interpret newlines as `<br />`-tags. |
||
34 | * This feature is useful for comments where newlines are often meant to be real new lines. |
||
35 | */ |
||
36 | public $enableNewlines = false; |
||
37 | |||
38 | /** |
||
39 | * @inheritDoc |
||
40 | */ |
||
41 | protected $escapeCharacters = [ |
||
42 | // from Markdown |
||
43 | '\\', // backslash |
||
44 | '`', // backtick |
||
45 | '*', // asterisk |
||
46 | '_', // underscore |
||
47 | '{', '}', // curly braces |
||
48 | '[', ']', // square brackets |
||
49 | '(', ')', // parentheses |
||
50 | '#', // hash mark |
||
51 | '+', // plus sign |
||
52 | '-', // minus sign (hyphen) |
||
53 | '.', // dot |
||
54 | '!', // exclamation mark |
||
55 | '<', '>', |
||
56 | // added by GithubMarkdown |
||
57 | ':', // colon |
||
58 | '|', // pipe |
||
59 | ]; |
||
60 | |||
61 | |||
62 | /** |
||
63 | * Consume lines for a paragraph |
||
64 | * |
||
65 | * Allow headlines, lists and code to break paragraphs |
||
66 | */ |
||
67 | 13 | protected function consumeParagraph($lines, $current) |
|
90 | |||
91 | /** |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | 2 | protected function renderCode($block) |
|
99 | |||
100 | /** |
||
101 | * @inheritdoc |
||
102 | */ |
||
103 | 2 | protected function renderAutoUrl($block) |
|
107 | |||
108 | /** |
||
109 | * @inheritdoc |
||
110 | */ |
||
111 | 1 | protected function renderStrike($block) |
|
115 | |||
116 | /** |
||
117 | * @inheritdocs |
||
118 | * |
||
119 | * Parses a newline indicated by two spaces on the end of a markdown line. |
||
120 | */ |
||
121 | 13 | protected function renderText($text) |
|
129 | |||
130 | private $_tableCellHead = false; |
||
131 | private $_tds = 0; |
||
132 | |||
133 | 1 | protected function renderTable($block) |
|
165 | |||
166 | /** |
||
167 | * @marker | |
||
168 | */ |
||
169 | 1 | protected function parseTd($markdown) |
|
177 | |||
178 | 1 | protected function renderTableSep($block) |
|
182 | } |
||
183 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.