1 | <?php |
||
31 | trait ClauseTrait |
||
32 | { |
||
33 | /** |
||
34 | * storage for clauses |
||
35 | * |
||
36 | * @var array |
||
37 | * @access protected |
||
38 | */ |
||
39 | protected $clause = []; |
||
40 | |||
41 | /** |
||
42 | * Is $str a raw string ? |
||
43 | * |
||
44 | * @param mixed $str |
||
45 | * @param bool $rawMode |
||
46 | * @access protected |
||
47 | */ |
||
48 | protected function isRaw($str, /*# bool */ $rawMode)/*# : bool */ |
||
59 | |||
60 | /** |
||
61 | * Quote an alias if not an int |
||
62 | * |
||
63 | * @param int|string $alias |
||
64 | * @return string |
||
65 | * @access protected |
||
66 | */ |
||
67 | protected function quoteAlias($alias)/*# : string */ |
||
71 | |||
72 | /** |
||
73 | * Quote an item with spaces allowed in between |
||
74 | * |
||
75 | * @param string|StatementInterface $item |
||
76 | * @param bool $rawMode |
||
77 | * @access protected |
||
78 | */ |
||
79 | protected function quoteItem( |
||
89 | |||
90 | /** |
||
91 | * Return specific clause part |
||
92 | * |
||
93 | * @param string $clauseName |
||
94 | * @param array |
||
95 | * @access protected |
||
96 | */ |
||
97 | protected function &getClause(/*# string */ $clauseName)/*# : array */ |
||
108 | |||
109 | /** |
||
110 | * Convert a template 'COUNT(%s)' to 'COUNT(`score`)' |
||
111 | * |
||
112 | * @param string $template |
||
113 | * @param string|string[] $col column[s] |
||
114 | * @return string |
||
115 | * @access protected |
||
116 | */ |
||
117 | protected function clauseTpl(/*# string */ $template, $col)/*# : string */ |
||
125 | |||
126 | protected function quote(/*# string */ $str)/*# : string */ |
||
131 | |||
132 | protected function quoteSpace(/*# string */ $str)/*# : string */ |
||
137 | |||
138 | /** |
||
139 | * Process value |
||
140 | * |
||
141 | * @param mixed $value |
||
142 | * @return string |
||
143 | * @access protected |
||
144 | */ |
||
145 | protected function processValue($value)/*# : string */ |
||
150 | |||
151 | /** |
||
152 | * Join each clause |
||
153 | * |
||
154 | * @param string $prefix |
||
155 | * @param string $seperator |
||
156 | * @param array $clause |
||
157 | * @param array $settings |
||
158 | * @return string |
||
159 | * @access protected |
||
160 | */ |
||
161 | protected function joinClause( |
||
175 | } |
||
176 |
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.