| 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 |
||
| 76 | protected function migration() |
||
| 77 | { |
||
| 78 | if (! class_exists('NotificationCategories')) { |
||
| 79 | $this->publishMigration('2014_02_10_145728_notification_categories'); |
||
| 80 | } |
||
| 81 | if (! class_exists('CreateNotificationGroupsTable')) { |
||
| 82 | $this->publishMigration('2014_08_01_210813_create_notification_groups_table'); |
||
| 83 | } |
||
| 84 | if (! class_exists('CreateNotificationCategoryNotificationGroupTable')) { |
||
| 85 | $this->publishMigration('2014_08_01_211045_create_notification_category_notification_group_table'); |
||
| 86 | } |
||
| 87 | if (! class_exists('CreateNotificationsTable')) { |
||
| 88 | $this->publishMigration('2015_05_05_212549_create_notifications_table'); |
||
| 89 | } |
||
| 90 | if (! class_exists('AddExpireTimeColumnToNotificationTable')) { |
||
| 91 | $this->publishMigration('2015_06_06_211555_add_expire_time_column_to_notification_table'); |
||
| 92 | } |
||
| 93 | if (! class_exists('ChangeTypeToExtraInNotificationsTable')) { |
||
| 94 | $this->publishMigration('2015_06_06_211555_change_type_to_extra_in_notifications_table'); |
||
| 95 | } |
||
| 96 | if (! class_exists('AlterCategoryNameToUnique')) { |
||
| 97 | $this->publishMigration('2015_06_07_211555_alter_category_name_to_unique'); |
||
| 98 | } |
||
| 99 | if (! class_exists('MakeNotificationUrlNullable')) { |
||
| 100 | $this->publishMigration('2016_04_19_200827_make_notification_url_nullable'); |
||
| 101 | } |
||
| 102 | if (! class_exists('AddStackIdToNotifications')) { |
||
| 103 | $this->publishMigration('2016_05_19_144531_add_stack_id_to_notifications'); |
||
| 104 | } |
||
| 105 | } |
||
| 106 | |||
| 132 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.