From fdba6bb996be4826eb6a4df7543665c29de12c6d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 20 Nov 2019 22:28:04 +0100 Subject: [PATCH] cleanup and tests added for ci/cd --- Models/Category.php | 81 ++++++++++++++ Models/Cause.php | 98 +++++++++++++++++ Models/Department.php | 48 +++++++++ Models/Process.php | 96 +++++++++++++++++ Models/Project.php | 48 +++++++++ Models/Risk.php | 210 ++++++++++++++++++++++++++++++++++++- Models/RiskObject.php | 48 +++++++++ Models/RiskObjectScore.php | 27 +++++ Models/RiskScore.php | 27 +++++ Models/Solution.php | 80 ++++++++++++++ 10 files changed, 762 insertions(+), 1 deletion(-) diff --git a/Models/Category.php b/Models/Category.php index 5407f58..b677686 100644 --- a/Models/Category.php +++ b/Models/Category.php @@ -33,6 +33,7 @@ class Category protected int $id = 0; private $title = ''; + /** * Description. * @@ -66,41 +67,105 @@ class Category return $this->id; } + /** + * Get parent category. + * + * @return mixed + * + * @since 1.0.0 + */ public function getParent() { return $this->parent; } + /** + * Set parent category. + * + * @param mixed $parent Parent category + * + * @return void + * + * @since 1.0.0 + */ public function setParent($parent) : void { $this->parent = $parent; } + /** + * Get responsible. + * + * @return mixed + * + * @since 1.0.0 + */ public function getResponsible() { return $this->responsible; } + /** + * Set responsible. + * + * @param mixed $responsible Responsible + * + * @return void + * + * @since 1.0.0 + */ public function setResponsible($responsible) : void { $this->responsible = $responsible; } + /** + * Set deputy. + * + * @param mixed $deputy Deputy + * + * @return void + * + * @since 1.0.0 + */ public function setDeputy($deputy) : void { $this->deputy = $deputy; } + /** + * Get deputy. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDeputy() { return $this->deputy; } + /** + * Get title. + * + * @return string + * + * @since 1.0.0 + */ public function getTitle() : string { return $this->title; } + /** + * Set title. + * + * @param string $title Title + * + * @return void + * + * @since 1.0.0 + */ public function setTitle(string $title) : void { $this->title = $title; @@ -118,11 +183,27 @@ class Category return $this->description; } + /** + * Get raw description. + * + * @return string + * + * @since 1.0.0 + */ public function getDescriptionRaw() : string { return $this->descriptionRaw; } + /** + * Set raw description + * + * @param string $description Description + * + * @return void + * + * @since 1.0.0 + */ public function setDescriptionRaw(string $description) : void { $this->descriptionRaw = $description; diff --git a/Models/Cause.php b/Models/Cause.php index 4978325..85a2bef 100644 --- a/Models/Cause.php +++ b/Models/Cause.php @@ -33,6 +33,7 @@ class Cause protected int $id = 0; private $title = ''; + /** * Description. * @@ -40,6 +41,7 @@ class Cause * @since 1.0.0 */ private string $description = ''; + /** * Description. * @@ -68,51 +70,131 @@ class Cause return $this->id; } + /** + * Set risk. + * + * @param mixed $risk Risk + * + * @return void + * + * @since 1.0.0 + */ public function setRisk($risk) : void { $this->risk = $risk; } + /** + * Get risk. + * + * @return mixed + * + * @since 1.0.0 + */ public function getRisk() { return $this->risk; } + /** + * Get category. + * + * @return mixed + * + * @since 1.0.0 + */ public function getCategory() { return $this->category; } + /** + * Set category. + * + * @param mixed $category Category + * + * @return void + * + * @since 1.0.0 + */ public function setCategory($category) : void { $this->category = $category; } + /** + * Get probability. + * + * @return int + * + * @since 1.0.0 + */ public function getProbability() : int { return $this->probability; } + /** + * Set probability. + * + * @param int $probability Probability + * + * @return void + * + * @since 1.0.0 + */ public function setProbability(int $probability) : void { $this->probability = $probability; } + /** + * Get department. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDepartment() { return $this->department; } + /** + * Set department. + * + * @param mixed $department Department + * + * @return void + * + * @since 1.0.0 + */ public function setDepartment($department) : void { $this->department = $department; } + /** + * Get title. + * + * @return string + * + * @since 1.0.0 + */ public function getTitle() : string { return $this->title; } + /** + * Set title. + * + * @param string $title Title + * + * @return void + * + * @since 1.0.0 + */ public function setTitle(string $title) : void { $this->title = $title; @@ -130,11 +212,27 @@ class Cause return $this->description; } + /** + * Get raw description. + * + * @return string + * + * @since 1.0.0 + */ public function getDescriptionRaw() : string { return $this->descriptionRaw; } + /** + * Set raw description. + * + * @param string $description Description + * + * @return void + * + * @since 1.0.0 + */ public function setDescriptionRaw(string $description) : void { $this->descriptionRaw = $description; diff --git a/Models/Department.php b/Models/Department.php index f93640d..74cdd63 100644 --- a/Models/Department.php +++ b/Models/Department.php @@ -52,31 +52,79 @@ class Department return $this->id; } + /** + * Get department. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDepartment() { return $this->department ?? new NullOrgDepartment(); } + /** + * Set department. + * + * @param mixed $department Department + * + * @return void + * + * @since 1.0.0 + */ public function setDepartment($department) : void { $this->department = $department; } + /** + * Get responsible. + * + * @return mixed + * + * @since 1.0.0 + */ public function getResponsible() { return $this->responsible; } + /** + * set responsible. + * + * @param mixed $responsible Responsible + * + * @return void + * + * @since 1.0.0 + */ public function setResponsible($responsible) : void { $this->responsible = $responsible; } + /** + * Get deputy. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDeputy() { return $this->deputy; } + /** + * Set deputy. + * + * @param mixed $deputy Deputy + * + * @return void + * + * @since 1.0.0 + */ public function setDeputy($deputy) : void { $this->deputy = $deputy; diff --git a/Models/Process.php b/Models/Process.php index 9c4fe0d..421640c 100644 --- a/Models/Process.php +++ b/Models/Process.php @@ -68,11 +68,27 @@ class Process return $this->id; } + /** + * Get title. + * + * @return string + * + * @since 1.0.0 + */ public function getTitle() : string { return $this->title; } + /** + * Set title. + * + * @param string $title Title + * + * @return void + * + * @since 1.0.0 + */ public function setTitle(string $title) : void { $this->title = $title; @@ -90,51 +106,131 @@ class Process return $this->description; } + /** + * Get raw description. + * + * @return string + * + * @since 1.0.0 + */ public function getDescriptionRaw() : string { return $this->descriptionRaw; } + /** + * Set raw description. + * + * @param string $description Description + * + * @return void + * + * @since 1.0.0 + */ public function setDescriptionRaw(string $description) : void { $this->descriptionRaw = $description; } + /** + * Get unit. + * + * @return mixed + * + * @since 1.0.0 + */ public function getUnit() { return $this->unit; } + /** + * Set unit. + * + * @param mixed $unit Unit + * + * @return void + * + * @since 1.0.0 + */ public function setUnit($unit) : void { $this->unit = $unit; } + /** + * Get department. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDepartment() { return $this->department; } + /** + * Set department. + * + * @param mixed $department Department + * + * @return void + * + * @since 1.0.0 + */ public function setDepartment($department) : void { $this->department = $department; } + /** + * Get responsible. + * + * @return mixed + * + * @since 1.0.0 + */ public function getResponsible() { return $this->responsible; } + /** + * Set responsible. + * + * @param mixed $responsible Responsible + * + * @return void + * + * @since 1.0.0 + */ public function setResponsible($responsible) : void { $this->responsible = $responsible; } + /** + * Get deputy. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDeputy() { return $this->deputy; } + /** + * Set deputy. + * + * @param mixed $deputy Deputy + * + * @return void + * + * @since 1.0.0 + */ public function setDeputy($deputy) : void { $this->deputy = $deputy; diff --git a/Models/Project.php b/Models/Project.php index e498a06..8e143ce 100644 --- a/Models/Project.php +++ b/Models/Project.php @@ -50,31 +50,79 @@ class Project return $this->id; } + /** + * Get project. + * + * @return mixed + * + * @since 1.0.0 + */ public function getProject() { return $this->project; } + /** + * Set project. + * + * @param mixed $project Project + * + * @return void + * + * @since 1.0.0 + */ public function setProject($project) : void { $this->project = $project; } + /** + * Get responsible. + * + * @return mixed + * + * @since 1.0.0 + */ public function getResponsible() { return $this->responsible; } + /** + * Set responsible. + * + * @param mixed $responsible Responsible + * + * @return void + * + * @since 1.0.0 + */ public function setResponsible($responsible) : void { $this->responsible = $responsible; } + /** + * Get deputy. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDeputy() { return $this->deputy; } + /** + * Set deputy. + * + * @param mixed $deputy Deputy + * + * @return void + * + * @since 1.0.0 + */ public function setDeputy($deputy) : void { $this->deputy = $deputy; diff --git a/Models/Risk.php b/Models/Risk.php index ff972b3..9f1a063 100644 --- a/Models/Risk.php +++ b/Models/Risk.php @@ -102,51 +102,131 @@ class Risk return $this->id; } + /** + * Add cause. + * + * @param mixed $cause Cause + * + * @return void + * + * @since 1.0.0 + */ public function addCause($cause) : void { $this->causes[] = $cause; } + /** + * Get causes + * + * @return array + * + * @since 1.0.0 + */ public function getCauses() : array { return $this->causes; } - public function addSolution($solution) : void /* : solution */ + /** + * Add solution. + * + * @param mixed $solution Solution + * + * @return void + * + * @since 1.0.0 + */ + public function addSolution($solution) : void { $this->solutions[] = $solution; } + /** + * Get solutions + * + * @return array + * + * @since 1.0.0 + */ public function getSolutions() : array { return $this->solutions; } + /** + * Get media + * + * @return array + * + * @since 1.0.0 + */ public function getMedia() : array { return $this->media; } + /** + * Add media. + * + * @param mixed $media Media + * + * @return void + * + * @since 1.0.0 + */ public function addMedia($media) : void { $this->media[] = $media; } + /** + * Add risk object. + * + * @param mixed $object Risk object + * + * @return void + * + * @since 1.0.0 + */ public function addRiskObject($object) : void { $this->riskObjects[] = $object; } + /** + * Get risk objects + * + * @return array + * + * @since 1.0.0 + */ public function getRiskObjects() : array { return $this->riskObjects; } + /** + * Add history. + * + * @param mixed $history History + * + * @return void + * + * @since 1.0.0 + */ public function addHistory($history) : void { $this->histScore[] = $history; } + /** + * Get history + * + * @return array + * + * @since 1.0.0 + */ public function getHistory() : array { return $this->histScore; @@ -190,81 +270,209 @@ class Risk return $this->description; } + /** + * Set raw description. + * + * @param string $description Description + * + * @return void + * + * @since 1.0.0 + */ public function setDescriptionRaw(string $description) : void { $this->descriptionRaw = $description; } + /** + * Get raw description. + * + * @return string + * + * @since 1.0.0 + */ public function getDescriptionRaw() : string { return $this->descriptionRaw; } + /** + * Get unit. + * + * @return mixed + * + * @since 1.0.0 + */ public function getUnit() { return $this->unit; } + /** + * Set unit. + * + * @param mixed $unit Unit + * + * @return void + * + * @since 1.0.0 + */ public function setUnit($unit) : void { $this->unit = $unit; } + /** + * Get department. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDepartment() { return $this->department; } + /** + * Set department. + * + * @param mixed $department Department + * + * @return void + * + * @since 1.0.0 + */ public function setDepartment($department) : void { $this->department = $department; } + /** + * Get category. + * + * @return mixed + * + * @since 1.0.0 + */ public function getCategory() { return $this->category; } + /** + * Set category. + * + * @param mixed $category Category + * + * @return void + * + * @since 1.0.0 + */ public function setCategory($category) : void { $this->category = $category; } + /** + * Get project. + * + * @return mixed + * + * @since 1.0.0 + */ public function getProject() { return $this->project; } + /** + * Set project. + * + * @param mixed $project Project + * + * @return void + * + * @since 1.0.0 + */ public function setProject($project) : void { $this->project = $project; } + /** + * Get process. + * + * @return mixed + * + * @since 1.0.0 + */ public function getProcess() { return $this->process; } + /** + * Set process. + * + * @param mixed $process Process + * + * @return void + * + * @since 1.0.0 + */ public function setProcess($process) : void { $this->process = $process; } + /** + * Get responsible. + * + * @return mixed + * + * @since 1.0.0 + */ public function getResponsible() { return $this->responsible; } + /** + * Set responsible. + * + * @param mixed $responsible Responsible + * + * @return void + * + * @since 1.0.0 + */ public function setResponsible($responsible) : void { $this->responsible = $responsible; } + /** + * Get deputy. + * + * @return mixed + * + * @since 1.0.0 + */ public function getDeputy() { return $this->deputy; } + /** + * Set deputy. + * + * @param mixed $deputy Deputy + * + * @return void + * + * @since 1.0.0 + */ public function setDeputy($deputy) : void { $this->deputy = $deputy; diff --git a/Models/RiskObject.php b/Models/RiskObject.php index d1c7e5a..da0e1da 100644 --- a/Models/RiskObject.php +++ b/Models/RiskObject.php @@ -62,21 +62,53 @@ class RiskObject return $this->id; } + /** + * Get risk. + * + * @return mixed + * + * @since 1.0.0 + */ public function getRisk() { return $this->risk; } + /** + * Set risk. + * + * @param mixed $risk Risk + * + * @return void + * + * @since 1.0.0 + */ public function setRisk($risk) : void { $this->risk = $risk; } + /** + * Get title. + * + * @return string + * + * @since 1.0.0 + */ public function getTitle() : string { return $this->title; } + /** + * Set title. + * + * @param string $title Title + * + * @return void + * + * @since 1.0.0 + */ public function setTitle(string $title) : void { $this->title = $title; @@ -94,11 +126,27 @@ class RiskObject return $this->description; } + /** + * Get raw description. + * + * @return string + * + * @since 1.0.0 + */ public function getDescriptionRaw() : string { return $this->descriptionRaw; } + /** + * Set raw description. + * + * @param string $description Description + * + * @return void + * + * @since 1.0.0 + */ public function setDescriptionRaw(string $description) : void { $this->descriptionRaw = $description; diff --git a/Models/RiskObjectScore.php b/Models/RiskObjectScore.php index e69de29..a481dc6 100644 --- a/Models/RiskObjectScore.php +++ b/Models/RiskObjectScore.php @@ -0,0 +1,27 @@ +id; } + /** + * Set risk. + * + * @param mixed $risk Risk + * + * @return void + * + * @since 1.0.0 + */ public function setRisk($risk) : void { $this->risk = $risk; } + /** + * Get risk. + * + * @return mixed + * + * @since 1.0.0 + */ public function getRisk() { return $this->risk; } + /** + * Set cause. + * + * @param mixed $cause Cause + * + * @return void + * + * @since 1.0.0 + */ public function setCause($cause) : void { $this->cause = $cause; } + /** + * Get cause. + * + * @return mixed + * + * @since 1.0.0 + */ public function getCause() { return $this->cause; } + /** + * Get probability. + * + * @return int + * + * @since 1.0.0 + */ public function getProbability() : int { return $this->probability; } + /** + * Set probability. + * + * @param int $probability Probability + * + * @return void + * + * @since 1.0.0 + */ public function setProbability(int $probability) : void { $this->probability = $probability; } + /** + * Get title. + * + * @return string + * + * @since 1.0.0 + */ public function getTitle() : string { return $this->title; } + /** + * Set title. + * + * @param string $title Title + * + * @return void + * + * @since 1.0.0 + */ public function setTitle(string $title) : void { $this->title = $title; @@ -118,11 +182,27 @@ class Solution return $this->description; } + /** + * Get raw description. + * + * @return string + * + * @since 1.0.0 + */ public function getDescriptionRaw() : string { return $this->descriptionRaw; } + /** + * Set raw description. + * + * @param string $description Description + * + * @return void + * + * @since 1.0.0 + */ public function setDescriptionRaw(string $description) : void { $this->descriptionRaw = $description;