| Conditions | 1 |
| Paths | 1 |
| Total Lines | 74 |
| Code Lines | 59 |
| Lines | 0 |
| Ratio | 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 namespace Modules\User\Database\Seeders; |
||
| 26 | public function run() |
||
| 27 | { |
||
| 28 | $this->role->create(array( |
||
| 29 | 'name' => 'Admin', |
||
| 30 | 'permissions' => [ |
||
| 31 | 'dashboard.index' => 1, |
||
| 32 | /* Workbench */ |
||
| 33 | 'workshop.workbench.index' => 1, |
||
| 34 | 'workshop.workbench.generate' => 1, |
||
| 35 | 'workshop.workbench.migrate' => 1, |
||
| 36 | 'workshop.workbench.install' => 1, |
||
| 37 | 'workshop.workbench.seed' => 1, |
||
| 38 | 'workshop.modules.index' => 1, |
||
| 39 | 'workshop.modules.store' => 1, |
||
| 40 | 'workshop.generate.generate' => 1, |
||
| 41 | 'workshop.install.install' => 1, |
||
| 42 | 'workshop.migrate.migrate' => 1, |
||
| 43 | 'workshop.seed.seed' => 1, |
||
| 44 | /* Roles */ |
||
| 45 | 'user.roles.index' => 1, |
||
| 46 | 'user.roles.create' => 1, |
||
| 47 | 'user.roles.store' => 1, |
||
| 48 | 'user.roles.edit' => 1, |
||
| 49 | 'user.roles.update' => 1, |
||
| 50 | 'user.roles.destroy' => 1, |
||
| 51 | /* Users */ |
||
| 52 | 'user.users.index' => 1, |
||
| 53 | 'user.users.create' => 1, |
||
| 54 | 'user.users.store' => 1, |
||
| 55 | 'user.users.edit' => 1, |
||
| 56 | 'user.users.update' => 1, |
||
| 57 | 'user.users.destroy' => 1, |
||
| 58 | /* Menu */ |
||
| 59 | 'menu.menus.index' => 1, |
||
| 60 | 'menu.menus.create' => 1, |
||
| 61 | 'menu.menus.store' => 1, |
||
| 62 | 'menu.menus.edit' => 1, |
||
| 63 | 'menu.menus.update' => 1, |
||
| 64 | 'menu.menus.destroy' => 1, |
||
| 65 | 'menu.menuitem.index' => 1, |
||
| 66 | 'menu.menuitem.create' => 1, |
||
| 67 | 'menu.menuitem.store' => 1, |
||
| 68 | 'menu.menuitem.edit' => 1, |
||
| 69 | 'menu.menuitem.update' => 1, |
||
| 70 | 'menu.menuitem.destroy' => 1, |
||
| 71 | /* Media */ |
||
| 72 | 'media.media.index' => 1, |
||
| 73 | 'media.media.create' => 1, |
||
| 74 | 'media.media.store' => 1, |
||
| 75 | 'media.media.edit' => 1, |
||
| 76 | 'media.media.update' => 1, |
||
| 77 | 'media.media.destroy' => 1, |
||
| 78 | /* Settings */ |
||
| 79 | 'setting.settings.index' => 1, |
||
| 80 | 'setting.settings.store' => 1, |
||
| 81 | 'setting.settings.getModuleSettings' => 1, |
||
| 82 | /* Page */ |
||
| 83 | 'page.pages.index' => 1, |
||
| 84 | 'page.pages.create' => 1, |
||
| 85 | 'page.pages.store' => 1, |
||
| 86 | 'page.pages.edit' => 1, |
||
| 87 | 'page.pages.update' => 1, |
||
| 88 | 'page.pages.destroy' => 1, |
||
| 89 | ], |
||
| 90 | )); |
||
| 91 | |||
| 92 | // Create an Users group |
||
| 93 | $this->role->create(array( |
||
| 94 | 'name' => 'User', |
||
| 95 | 'permissions' => [ |
||
| 96 | 'dashboard.index' => 1, |
||
| 97 | ], |
||
| 98 | )); |
||
| 99 | } |
||
| 100 | } |
||
| 101 |