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

Issue #3356362: Make it possible to get max private repos from the plan

parent db2af846
No related branches found
No related tags found
1 merge request!9Issue #3356362: Make it possible to get max private repos from the plan
......@@ -14,6 +14,13 @@ class Plan implements PlanInterface {
*/
protected $planType;
/**
* The max.
*
* @var int
*/
private $maxRepos;
/**
* Constructor.
*/
......@@ -21,11 +28,24 @@ class Plan implements PlanInterface {
$this->planType = $plan_type;
}
/**
* Setter.
*/
public function setMaxPrivateRepos(int $max) {
$this->maxRepos = $max;
}
/**
* {@inheritdoc}
*/
public function getMaxPrivateRepos() {
public function getMaxPrivateRepos() : int {
switch ($this->planType) {
case self::ENTERPRISE_PLAN:
if (!$this->maxRepos) {
$this->maxRepos = 10;
}
return $this->maxRepos;
case self::PREMIUM_PLAN:
return self::PREMIUM_PLAN_MAX;
......
......@@ -23,6 +23,6 @@ interface PlanInterface {
/**
* Get the max for the plan.
*/
public function getMaxPrivateRepos();
public function getMaxPrivateRepos() : int;
}
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