| Conditions | 11 |
| Paths | 10 |
| Total Lines | 36 |
| Code Lines | 21 |
| 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 |
||
| 23 | public function inflectPackageVars($vars) |
||
| 24 | { |
||
| 25 | |||
| 26 | |||
| 27 | if ($this->package->getTargetDir()) { |
||
|
|
|||
| 28 | $vars['install_item_dir'] = $this->package->getTargetDir(); |
||
| 29 | } else { |
||
| 30 | $vars['install_item_dir'] = $vars['name']; |
||
| 31 | if ($vars['type'] === 'microweber-template') { |
||
| 32 | return $this->inflectTemplateVars($vars); |
||
| 33 | } |
||
| 34 | if ($vars['type'] === 'microweber-templates') { |
||
| 35 | return $this->inflectTemplatesVars($vars); |
||
| 36 | } |
||
| 37 | if ($vars['type'] === 'microweber-core') { |
||
| 38 | return $this->inflectCoreVars($vars); |
||
| 39 | } |
||
| 40 | if ($vars['type'] === 'microweber-adapter') { |
||
| 41 | return $this->inflectCoreVars($vars); |
||
| 42 | } |
||
| 43 | if ($vars['type'] === 'microweber-module') { |
||
| 44 | return $this->inflectModuleVars($vars); |
||
| 45 | } |
||
| 46 | if ($vars['type'] === 'microweber-modules') { |
||
| 47 | return $this->inflectModulesVars($vars); |
||
| 48 | } |
||
| 49 | if ($vars['type'] === 'microweber-skin') { |
||
| 50 | return $this->inflectSkinVars($vars); |
||
| 51 | } |
||
| 52 | if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') { |
||
| 53 | return $this->inflectElementVars($vars); |
||
| 54 | } |
||
| 55 | } |
||
| 56 | |||
| 57 | |||
| 58 | return $vars; |
||
| 59 | } |
||
| 120 |
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.