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