| Conditions | 1 |
| Paths | 1 |
| Total Lines | 64 |
| Code Lines | 50 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
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 |
||
| 29 | public function __construct() |
||
| 30 | { |
||
| 31 | $this->subMenu = [ |
||
| 32 | 'profiles' => [ |
||
| 33 | 'title' => trans('gitamin.profiles.profiles'), |
||
| 34 | 'url' => route('profile.index'), |
||
| 35 | 'icon' => 'fa fa-user', |
||
| 36 | 'active' => false, |
||
| 37 | ], |
||
| 38 | 'account' => [ |
||
| 39 | 'title' => trans('gitamin.profiles.account'), |
||
| 40 | 'url' => route('profile.index'), |
||
| 41 | 'icon' => 'fa fa-gear', |
||
| 42 | 'active' => false, |
||
| 43 | ], |
||
| 44 | 'emails' => [ |
||
| 45 | 'title' => trans('gitamin.profiles.emails'), |
||
| 46 | 'url' => route('profile.index'), |
||
| 47 | 'icon' => 'fa fa-envelope-o', |
||
| 48 | 'active' => false, |
||
| 49 | ], |
||
| 50 | 'password' => [ |
||
| 51 | 'title' => trans('gitamin.profiles.password'), |
||
| 52 | 'url' => route('profile.index'), |
||
| 53 | 'icon' => 'fa fa-lock', |
||
| 54 | 'active' => false, |
||
| 55 | ], |
||
| 56 | 'notifications' => [ |
||
| 57 | 'title' => trans('gitamin.profiles.notifications'), |
||
| 58 | 'url' => route('profile.index'), |
||
| 59 | 'icon' => 'fa fa-inbox', |
||
| 60 | 'active' => false, |
||
| 61 | ], |
||
| 62 | 'ssh_keys' => [ |
||
| 63 | 'title' => trans('gitamin.profiles.ssh_keys'), |
||
| 64 | 'url' => route('profile.index'), |
||
| 65 | 'icon' => 'fa fa-key', |
||
| 66 | 'active' => false, |
||
| 67 | ], |
||
| 68 | 'applications' => [ |
||
| 69 | 'title' => trans('gitamin.profiles.applications'), |
||
| 70 | 'url' => route('profile.index'), |
||
| 71 | 'icon' => 'fa fa-cloud', |
||
| 72 | 'active' => false, |
||
| 73 | ], |
||
| 74 | 'preferences' => [ |
||
| 75 | 'title' => trans('gitamin.profiles.preferences'), |
||
| 76 | 'url' => route('profile.index'), |
||
| 77 | 'icon' => 'fa fa-image', |
||
| 78 | 'active' => false, |
||
| 79 | ], |
||
| 80 | 'audit_log' => [ |
||
| 81 | 'title' => trans('gitamin.profiles.audit_log'), |
||
| 82 | 'url' => route('profile.index'), |
||
| 83 | 'icon' => 'fa fa-history', |
||
| 84 | 'active' => false, |
||
| 85 | ], |
||
| 86 | ]; |
||
| 87 | |||
| 88 | View::share([ |
||
| 89 | 'sub_menu' => $this->subMenu, |
||
| 90 | 'sub_title' => trans_choice('dashboard.projects.projects', 2), |
||
| 91 | ]); |
||
| 92 | } |
||
| 93 | |||
| 122 |