| Conditions | 11 |
| Paths | 1024 |
| Total Lines | 33 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 9 | ||
| Bugs | 2 | Features | 4 |
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 |
||
| 137 | protected function migration() |
||
| 138 | { |
||
| 139 | if (! class_exists('NotificationCategories')) { |
||
| 140 | $this->publishMigration('2014_02_10_145728_notification_categories'); |
||
| 141 | } |
||
| 142 | if (! class_exists('CreateNotificationGroupsTable')) { |
||
| 143 | $this->publishMigration('2014_08_01_210813_create_notification_groups_table'); |
||
| 144 | } |
||
| 145 | if (! class_exists('CreateNotificationCategoryNotificationGroupTable')) { |
||
| 146 | $this->publishMigration('2014_08_01_211045_create_notification_category_notification_group_table'); |
||
| 147 | } |
||
| 148 | if (! class_exists('CreateNotificationsTable')) { |
||
| 149 | $this->publishMigration('2015_05_05_212549_create_notifications_table'); |
||
| 150 | } |
||
| 151 | if (! class_exists('AddExpireTimeColumnToNotificationTable')) { |
||
| 152 | $this->publishMigration('2015_06_06_211555_add_expire_time_column_to_notification_table'); |
||
| 153 | } |
||
| 154 | if (! class_exists('ChangeTypeToExtraInNotificationsTable')) { |
||
| 155 | $this->publishMigration('2015_06_06_211555_change_type_to_extra_in_notifications_table'); |
||
| 156 | } |
||
| 157 | if (! class_exists('AlterCategoryNameToUnique')) { |
||
| 158 | $this->publishMigration('2015_06_07_211555_alter_category_name_to_unique'); |
||
| 159 | } |
||
| 160 | if (! class_exists('MakeNotificationUrlNullable')) { |
||
| 161 | $this->publishMigration('2016_04_19_200827_make_notification_url_nullable'); |
||
| 162 | } |
||
| 163 | if (! class_exists('AddStackIdToNotifications')) { |
||
| 164 | $this->publishMigration('2016_05_19_144531_add_stack_id_to_notifications'); |
||
| 165 | } |
||
| 166 | if (! class_exists('UpdateVersion4NotificationsTable')) { |
||
| 167 | $this->publishMigration('2016_07_01_153156_update_version4_notifications_table'); |
||
| 168 | } |
||
| 169 | } |
||
| 170 | |||
| 201 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.