Skip to content

Commit

Permalink
Use break on all switch cases
Browse files Browse the repository at this point in the history
  • Loading branch information
stevotvr committed Apr 8, 2019
1 parent 2879d69 commit c0b07e7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
16 changes: 11 additions & 5 deletions acp/main_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public function main($id, $mode)
{
case 'packages':
$this->manage_packages();
break;
break;
case 'subscriptions':
$this->manage_subscriptions();
break;
break;
case 'transactions':
$this->manage_transactions();
break;
break;
default:
$this->settings();
}
Expand Down Expand Up @@ -83,19 +83,22 @@ protected function manage_packages()
$this->page_title = 'ACP_GROUPSUB_PKG_ADD';
$controller->add();
return;
break;
case 'edit':
$this->page_title = 'ACP_GROUPSUB_PKG_EDIT';
$controller->edit($id);
return;
break;
case 'delete':
$controller->delete($id);
return;
break;
case 'move_up':
$controller->move($id, -1);
break;
break;
case 'move_down':
$controller->move($id, 1);
break;
break;
}

$this->page_title = 'ACP_GROUPSUB_MANAGE_PKGS';
Expand All @@ -121,13 +124,16 @@ protected function manage_subscriptions()
$this->page_title = 'ACP_GROUPSUB_SUB_ADD';
$controller->add();
return;
break;
case 'edit':
$this->page_title = 'ACP_GROUPSUB_SUB_EDIT';
$controller->edit($id);
return;
break;
case 'delete':
$controller->delete($id);
return;
break;
}

$this->page_title = 'ACP_GROUPSUB_MANAGE_SUBS';
Expand Down
2 changes: 2 additions & 0 deletions controller/acp_trans_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ protected function get_sort_field($sort_key)
{
case 'u':
return 'u.username';
break;
case 'a':
return 't.trans_amount';
break;
}

return 't.trans_time';
Expand Down
3 changes: 3 additions & 0 deletions ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function enable_step($old_state)
$phpbb_notifications->enable_notifications('stevotvr.groupsub.notification.type.warn');
$phpbb_notifications->enable_notifications('stevotvr.groupsub.notification.type.expired');
return 'notification';
break;
default:
return parent::enable_step($old_state);
}
Expand All @@ -40,6 +41,7 @@ public function disable_step($old_state)
$phpbb_notifications->disable_notifications('stevotvr.groupsub.notification.type.warn');
$phpbb_notifications->disable_notifications('stevotvr.groupsub.notification.type.expired');
return 'notification';
break;
default:
return parent::disable_step($old_state);
}
Expand All @@ -54,6 +56,7 @@ public function purge_step($old_state)
$phpbb_notifications->purge_notifications('stevotvr.groupsub.notification.type.warn');
$phpbb_notifications->purge_notifications('stevotvr.groupsub.notification.type.expired');
return 'notification';
break;
default:
return parent::purge_step($old_state);
}
Expand Down
4 changes: 4 additions & 0 deletions operator/unit_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ public function get_days($length, $unit)
{
case 'days':
return $length;
break;
case 'weeks':
return $length * self::WEEK;
break;
case 'months':
return $length * self::MONTH;
break;
case 'years':
return $length * self::YEAR;
break;
}

throw new unexpected_value('unit');
Expand Down

0 comments on commit c0b07e7

Please sign in to comment.