1 | <?php |
||
5 | class Query |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | protected $sql; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $sqlPrepared; |
||
16 | |||
17 | /** |
||
18 | * @var mixed[] |
||
19 | */ |
||
20 | protected $params = []; |
||
21 | |||
22 | /** |
||
23 | * @var string[] |
||
24 | */ |
||
25 | protected $escapeChars = [ |
||
26 | "\x00" => "\\0", |
||
27 | "\r" => "\\r", |
||
28 | "\n" => "\\n", |
||
29 | "\t" => "\\t", |
||
30 | "'" => "\'", |
||
31 | '"' => '\"', |
||
32 | "\\" => "\\\\", |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * @param string $sql |
||
37 | */ |
||
38 | public function __construct($sql) |
||
43 | |||
44 | /** |
||
45 | * Binding params for the query, mutiple arguments support. |
||
46 | * |
||
47 | * @param mixed $param |
||
|
|||
48 | * @return Query |
||
49 | */ |
||
50 | public function bindParams() |
||
57 | |||
58 | public function bindParamsFromArray(array $params) |
||
65 | |||
66 | public function escape($str) |
||
70 | |||
71 | /** |
||
72 | * @param mixed $value |
||
73 | * @return string |
||
74 | */ |
||
75 | protected function resolveValueForSql($value) |
||
107 | |||
108 | protected function buildSql() |
||
127 | |||
128 | /** |
||
129 | * Get the constructed and escaped sql string. |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | public function getSql() |
||
142 | } |
||
143 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.