1 | <?php |
||
8 | class QueryBuilder |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $parameters = []; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $query = ''; |
||
19 | |||
20 | /** |
||
21 | * @param string $field |
||
22 | * |
||
23 | * @return QueryBuilder |
||
24 | */ |
||
25 | public function select(string $field): QueryBuilder |
||
31 | |||
32 | /** |
||
33 | * @param string $field |
||
34 | * |
||
35 | * @return QueryBuilder |
||
36 | */ |
||
37 | public function addSelect(string $field): QueryBuilder |
||
43 | |||
44 | /** |
||
45 | * @param string $table |
||
46 | * |
||
47 | * @return QueryBuilder |
||
48 | */ |
||
49 | public function from(string $table): QueryBuilder |
||
55 | |||
56 | /** |
||
57 | * @param string $condition |
||
58 | * |
||
59 | * @return QueryBuilder |
||
60 | */ |
||
61 | public function where(string $condition): QueryBuilder |
||
67 | |||
68 | /** |
||
69 | * @param string $fieldName |
||
70 | * @param string $value |
||
71 | * @param bool $quoted |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getEqualCondition(string $fieldName, string $value, bool $quoted = true): string |
||
79 | |||
80 | /** |
||
81 | * @param string $fieldName |
||
82 | * @param string $value |
||
83 | * @param bool $quoted |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getNotEqualCondition(string $fieldName, string $value, bool $quoted = true): string |
||
91 | |||
92 | /** |
||
93 | * @param string $fieldName |
||
94 | * @param string $value |
||
95 | * @param bool $quoted |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public function getLikeCondition(string $fieldName, string $value, bool $quoted = true): string |
||
103 | |||
104 | /** |
||
105 | * @param string $condition |
||
106 | * |
||
107 | * @return QueryBuilder |
||
108 | */ |
||
109 | public function andWhere(string $condition): QueryBuilder |
||
115 | |||
116 | /** |
||
117 | * @param string $condition |
||
118 | * |
||
119 | * @return QueryBuilder |
||
120 | */ |
||
121 | public function orWhere(string $condition): QueryBuilder |
||
127 | |||
128 | /** |
||
129 | * @param string $condition |
||
|
|||
130 | * |
||
131 | * @return QueryBuilder |
||
132 | */ |
||
133 | public function orderBy(string $fieldName): QueryBuilder |
||
139 | |||
140 | /** |
||
141 | * @param string $name |
||
142 | * @param string $value |
||
143 | * |
||
144 | * @return QueryBuilder |
||
145 | */ |
||
146 | public function setParameter(string $name, string $value): QueryBuilder |
||
152 | |||
153 | /** |
||
154 | * @return string |
||
155 | */ |
||
156 | public function getQuery(): string |
||
166 | |||
167 | /** |
||
168 | * @param string $fieldName |
||
169 | * @param string $operator |
||
170 | * @param string $value |
||
171 | * @param bool $quoted |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | protected function setOperator(string $fieldName, string $operator, string $value, $quoted = true): string |
||
181 | } |
||
182 |
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.