| Conditions | 10 |
| Paths | 512 |
| Total Lines | 30 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 6 | ||
| Bugs | 1 | 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 |
||
| 106 | protected function migration() |
||
| 107 | { |
||
| 108 | if (! class_exists('NotificationCategories')) { |
||
| 109 | $this->publishMigration('2014_02_10_145728_notification_categories'); |
||
| 110 | } |
||
| 111 | if (! class_exists('CreateNotificationGroupsTable')) { |
||
| 112 | $this->publishMigration('2014_08_01_210813_create_notification_groups_table'); |
||
| 113 | } |
||
| 114 | if (! class_exists('CreateNotificationCategoryNotificationGroupTable')) { |
||
| 115 | $this->publishMigration('2014_08_01_211045_create_notification_category_notification_group_table'); |
||
| 116 | } |
||
| 117 | if (! class_exists('CreateNotificationsTable')) { |
||
| 118 | $this->publishMigration('2015_05_05_212549_create_notifications_table'); |
||
| 119 | } |
||
| 120 | if (! class_exists('AddExpireTimeColumnToNotificationTable')) { |
||
| 121 | $this->publishMigration('2015_06_06_211555_add_expire_time_column_to_notification_table'); |
||
| 122 | } |
||
| 123 | if (! class_exists('ChangeTypeToExtraInNotificationsTable')) { |
||
| 124 | $this->publishMigration('2015_06_06_211555_change_type_to_extra_in_notifications_table'); |
||
| 125 | } |
||
| 126 | if (! class_exists('AlterCategoryNameToUnique')) { |
||
| 127 | $this->publishMigration('2015_06_07_211555_alter_category_name_to_unique'); |
||
| 128 | } |
||
| 129 | if (! class_exists('MakeNotificationUrlNullable')) { |
||
| 130 | $this->publishMigration('2016_04_19_200827_make_notification_url_nullable'); |
||
| 131 | } |
||
| 132 | if (! class_exists('AddStackIdToNotifications')) { |
||
| 133 | $this->publishMigration('2016_05_19_144531_add_stack_id_to_notifications'); |
||
| 134 | } |
||
| 135 | } |
||
| 136 | |||
| 162 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.