Skip to content
Snippets Groups Projects
Commit aeaacfa3 authored by Eirik Morland's avatar Eirik Morland
Browse files

Issue #3486615 by eiriksm: Simplify switch statement for getting the plan

parent ae539e80
No related branches found
No related tags found
1 merge request!73Delete some code
Pipeline #334975 passed with warnings
......@@ -273,23 +273,17 @@ class TeamNode extends Node {
}
$plan_value = $this->get('field_plan')->first()->getString();
switch ($plan_value) {
case PlanInterface::PREMIUM_PLAN:
case PlanInterface::TRIAL_PLAN:
return new Plan($plan_value);
case PlanInterface::AGENCY_PLAN:
case PlanInterface::ENTERPRISE_PLAN:
$plan = new Plan($plan_value);
// Usually we are required to set what the max is on the team level.
$plan->setMaxPrivateRepos($this->getMaxPrivateRepos());
return $plan;
case PlanInterface::PREMIUM_PLAN:
return new Plan($plan_value);
case PlanInterface::AGENCY_PLAN:
$plan = new Plan($plan_value);
$plan->setMaxPrivateRepos($this->getMaxPrivateRepos());
return $plan;
default:
return $default;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment