| Conditions | 1 |
| Paths | 1 |
| Total Lines | 83 |
| Code Lines | 52 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 11 | public static function getDefaultConfiguration() { |
||
| 12 | return [ |
||
| 13 | 'database' => [ |
||
| 14 | 'user' => 'root', |
||
| 15 | 'password' => 'root', |
||
| 16 | 'prefix' => 'wp_', |
||
| 17 | 'name' => '', |
||
| 18 | 'host' => '127.0.0.1', |
||
| 19 | ], |
||
| 20 | 'plugins' => [ |
||
| 21 | [ |
||
| 22 | 'plugin' => 'jetpack', |
||
| 23 | 'activate' => false, |
||
| 24 | ], |
||
| 25 | [ |
||
| 26 | 'plugin' => 'crop-thumbnails', |
||
| 27 | 'activate' => true, |
||
| 28 | ], |
||
| 29 | [ |
||
| 30 | 'plugin' => 'query-monitor', |
||
| 31 | 'activate' => true, |
||
| 32 | ], |
||
| 33 | [ |
||
| 34 | 'plugin' => 'force-regenerate-thumbnails', |
||
| 35 | 'activate' => true, |
||
| 36 | ], |
||
| 37 | [ |
||
| 38 | 'plugin' => 'force-regenerate-thumbnails', |
||
| 39 | 'activate' => true, |
||
| 40 | ], |
||
| 41 | [ |
||
| 42 | 'plugin' => 'mailtrap-for-wp', |
||
| 43 | 'activate' => false, |
||
| 44 | ], |
||
| 45 | ], |
||
| 46 | 'user' => [ |
||
| 47 | 'name' => '', |
||
| 48 | 'email' => '', |
||
| 49 | 'password' => '', |
||
| 50 | ], |
||
| 51 | 'theme' => [ |
||
| 52 | 'type' => 'zip', |
||
| 53 | 'url' => 'https://github.com/matchboxdesigngroup/kindling/archive/1.0.1.zip', |
||
| 54 | 'name' => '', |
||
| 55 | ], |
||
| 56 | 'menus' => [ |
||
| 57 | [ |
||
| 58 | 'name' => 'Primary Navigation', |
||
| 59 | 'location' => 'primary_navigation', |
||
| 60 | ], |
||
| 61 | [ |
||
| 62 | 'name' => 'Footer Navigation', |
||
| 63 | 'location' => 'footer_navigation', |
||
| 64 | ], |
||
| 65 | [ |
||
| 66 | 'name' => 'Social Menu', |
||
| 67 | 'location' => 'social_menu', |
||
| 68 | ], |
||
| 69 | ], |
||
| 70 | 'site' => [ |
||
| 71 | 'title' => '', |
||
| 72 | 'url' => '', |
||
| 73 | ], |
||
| 74 | 'rewrite' => [ |
||
| 75 | 'structure' => '/%postname%/', |
||
| 76 | ], |
||
| 77 | 'commands' => [ |
||
| 78 | 'preInstall' => [], |
||
| 79 | 'postInstallTheme' => [ |
||
| 80 | 'yarn', |
||
| 81 | 'bower install', |
||
| 82 | ], |
||
| 83 | 'postInstall' => [], |
||
| 84 | ], |
||
| 85 | 'settings' => [ |
||
| 86 | 'afterInstall' => [ |
||
| 87 | 'removeUserPassword' => true, |
||
| 88 | 'removeUserEmail' => true, |
||
| 89 | 'removeUserName' => true, |
||
| 90 | ], |
||
| 91 | ], |
||
| 92 | ]; |
||
| 93 | } |
||
| 94 | } |
||
| 95 |