Conditions | 7 |
Paths | 3 |
Total Lines | 68 |
Code Lines | 53 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
174 | public function doProperties($msg = '') |
||
175 | { |
||
176 | $data = $this->misc->getDatabaseAccessor(); |
||
177 | |||
178 | $this->printTrail('operator'); |
||
179 | $this->printTitle($this->lang['strproperties'], 'pg.operator'); |
||
180 | $this->printMsg($msg); |
||
181 | |||
182 | $oprdata = $data->getOperator($_REQUEST['operator_oid']); |
||
183 | $oprdata->fields['oprcanhash'] = $data->phpBool($oprdata->fields['oprcanhash']); |
||
184 | |||
185 | if ($oprdata->recordCount() > 0) { |
||
186 | echo "<table>\n"; |
||
187 | echo "<tr><th class=\"data left\">{$this->lang['strname']}</th>\n"; |
||
188 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprname']), "</td></tr>\n"; |
||
189 | echo "<tr><th class=\"data left\">{$this->lang['strleftarg']}</th>\n"; |
||
190 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprleftname']), "</td></tr>\n"; |
||
191 | echo "<tr><th class=\"data left\">{$this->lang['strrightarg']}</th>\n"; |
||
192 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprrightname']), "</td></tr>\n"; |
||
193 | echo "<tr><th class=\"data left\">{$this->lang['strcommutator']}</th>\n"; |
||
194 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprcom']), "</td></tr>\n"; |
||
195 | echo "<tr><th class=\"data left\">{$this->lang['strnegator']}</th>\n"; |
||
196 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprnegate']), "</td></tr>\n"; |
||
197 | echo "<tr><th class=\"data left\">{$this->lang['strjoin']}</th>\n"; |
||
198 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprjoin']), "</td></tr>\n"; |
||
199 | echo "<tr><th class=\"data left\">{$this->lang['strhashes']}</th>\n"; |
||
200 | echo '<td class="data1">', ($oprdata->fields['oprcanhash']) ? $this->lang['stryes'] : $this->lang['strno'], "</td></tr>\n"; |
||
201 | |||
202 | // these field only exists in 8.2 and before in pg_catalog |
||
203 | if (isset($oprdata->fields['oprlsortop'])) { |
||
204 | echo "<tr><th class=\"data left\">{$this->lang['strmerges']}</th>\n"; |
||
205 | echo '<td class="data1">', ('0' !== $oprdata->fields['oprlsortop'] && '0' !== $oprdata->fields['oprrsortop']) ? $this->lang['stryes'] : $this->lang['strno'], "</td></tr>\n"; |
||
206 | echo "<tr><th class=\"data left\">{$this->lang['strrestrict']}</th>\n"; |
||
207 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprrest']), "</td></tr>\n"; |
||
208 | echo "<tr><th class=\"data left\">{$this->lang['strleftsort']}</th>\n"; |
||
209 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprlsortop']), "</td></tr>\n"; |
||
210 | echo "<tr><th class=\"data left\">{$this->lang['strrightsort']}</th>\n"; |
||
211 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprrsortop']), "</td></tr>\n"; |
||
212 | echo "<tr><th class=\"data left\">{$this->lang['strlessthan']}</th>\n"; |
||
213 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprltcmpop']), "</td></tr>\n"; |
||
214 | echo "<tr><th class=\"data left\">{$this->lang['strgreaterthan']}</th>\n"; |
||
215 | echo '<td class="data1">', $this->misc->printVal($oprdata->fields['oprgtcmpop']), "</td></tr>\n"; |
||
216 | } else { |
||
217 | echo "<tr><th class=\"data left\">{$this->lang['strmerges']}</th>\n"; |
||
218 | echo '<td class="data1">', $data->phpBool($oprdata->fields['oprcanmerge']) ? $this->lang['stryes'] : $this->lang['strno'], "</td></tr>\n"; |
||
219 | } |
||
220 | echo "</table>\n"; |
||
221 | |||
222 | $this->printNavLinks( |
||
223 | [ |
||
224 | 'showall' => [ |
||
225 | 'attr' => [ |
||
226 | 'href' => [ |
||
227 | 'url' => 'operators', |
||
228 | 'urlvars' => [ |
||
229 | 'server' => $_REQUEST['server'], |
||
230 | 'database' => $_REQUEST['database'], |
||
231 | 'schema' => $_REQUEST['schema'], |
||
232 | ], |
||
233 | ], |
||
234 | ], |
||
235 | 'content' => $this->lang['strshowalloperators'], |
||
236 | ], ], |
||
237 | 'operators-properties', |
||
238 | get_defined_vars() |
||
239 | ); |
||
240 | } else { |
||
241 | $this->doDefault($this->lang['strinvalidparam']); |
||
242 | } |
||
279 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.