From f888d66c222fa9514fc778caa759e787d7ea43c9 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 6 Oct 2019 17:50:12 +0200 Subject: [PATCH] phpcs fixes --- Models/WikiCategory.php | 44 ++++++++++--- Models/WikiDoc.php | 72 ++++++++++++++++++++-- Theme/Backend/Lang/Navigation.en.lang.php | 4 +- Theme/Backend/Lang/en.lang.php | 4 +- Theme/Backend/wiki-category-list.tpl.php | 4 +- Theme/Backend/wiki-category-single.tpl.php | 4 +- 6 files changed, 116 insertions(+), 16 deletions(-) diff --git a/Models/WikiCategory.php b/Models/WikiCategory.php index 042b718..6e48d39 100644 --- a/Models/WikiCategory.php +++ b/Models/WikiCategory.php @@ -24,26 +24,56 @@ namespace Modules\Knowledgebase\Models; */ class WikiCategory implements \JsonSerializable { - private $id = 0; - - private $name = ''; + /** + * ID. + * + * @var int + * @since 1.0.0 + */ + protected int $id = 0; + /** + * Name. + * + * @var string + * @since 1.0.0 + */ + private string $name = ''; private $parent = null; - public function __construct() - { - } - + /** + * Get id. + * + * @return int Model id + * + * @since 1.0.0 + */ public function getId() : int { return $this->id; } + /** + * Get name + * + * @return string + * + * @since 1.0.0 + */ public function getName() : string { return $this->name; } + /** + * Set name + * + * @param string $name Name + * + * @return void + * + * @since 1.0.0 + */ public function setName(string $name) : void { $this->name = $name; diff --git a/Models/WikiDoc.php b/Models/WikiDoc.php index e98f694..26c30d3 100644 --- a/Models/WikiDoc.php +++ b/Models/WikiDoc.php @@ -24,11 +24,22 @@ namespace Modules\Knowledgebase\Models; */ class WikiDoc implements \JsonSerializable { - private $id = 0; + /** + * ID. + * + * @var int + * @since 1.0.0 + */ + protected int $id = 0; + /** + * Name. + * + * @var string + * @since 1.0.0 + */ + private string $name = ''; - private $name = ''; - - private $status = WikiStatus::ACTIVE; + private int $status = WikiStatus::ACTIVE; private $doc = ''; @@ -42,11 +53,23 @@ class WikiDoc implements \JsonSerializable private $badges = []; + /** + * Constructor. + * + * @since 1.0.0 + */ public function __construct() { $this->createdAt = new \DateTime('now'); } + /** + * Get id. + * + * @return int Model id + * + * @since 1.0.0 + */ public function getId() : int { return $this->id; @@ -62,11 +85,27 @@ class WikiDoc implements \JsonSerializable $this->language = $language; } + /** + * Get name + * + * @return string + * + * @since 1.0.0 + */ public function getName() : string { return $this->name; } + /** + * Set name + * + * @param string $name Name + * + * @return void + * + * @since 1.0.0 + */ public function setName(string $name) : void { $this->name = $name; @@ -102,16 +141,39 @@ class WikiDoc implements \JsonSerializable $this->category = $category; } + /** + * Get created by + * + * @return int|\phpOMS\Account\Account + * + * @since 1.0.0 + */ public function getCreatedBy() : int { return $this->createdBy; } - public function setCreatedBy(int $id) : void + /** + * Set created by + * + * @param mixed $id Created by + * + * @return void + * + * @since 1.0.0 + */ + public function setCreatedBy($id) : void { $this->createdBy = $id; } + /** + * Get created at date time + * + * @return \DateTime + * + * @since 1.0.0 + */ public function getCreatedAt() : \DateTime { return $this->createdAt; diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index 253a5a2..5f94028 100644 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -1,4 +1,4 @@ - [ 'Wiki' => 'Wiki', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 6a220c0..8b6a14d 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -1,4 +1,4 @@ - [ 'Categories' => 'Categories', 'Name' => 'Name', diff --git a/Theme/Backend/wiki-category-list.tpl.php b/Theme/Backend/wiki-category-list.tpl.php index 062ce11..136513b 100644 --- a/Theme/Backend/wiki-category-list.tpl.php +++ b/Theme/Backend/wiki-category-list.tpl.php @@ -1,4 +1,4 @@ -getData('categories'); diff --git a/Theme/Backend/wiki-category-single.tpl.php b/Theme/Backend/wiki-category-single.tpl.php index 262ffcf..16e6297 100644 --- a/Theme/Backend/wiki-category-single.tpl.php +++ b/Theme/Backend/wiki-category-single.tpl.php @@ -1,7 +1,9 @@ -getData('nav')->render(); ?>