From c273cd8895c73bcdb77d92a1353e9e74ad8ec8fb 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/Comment.php | 89 ++++++++++++++++++++++++++++++++++++++++++ Models/CommentList.php | 23 ++++++++++- 2 files changed, 111 insertions(+), 1 deletion(-) diff --git a/Models/Comment.php b/Models/Comment.php index c781884..4faf56f 100644 --- a/Models/Comment.php +++ b/Models/Comment.php @@ -70,51 +70,131 @@ class Comment return $this->id; } + /** + * Reference id + * + * @param mixed $ref Reference + * + * @return void + * + * @since 1.0.0 + */ public function setRef($ref) : void { $this->ref = $ref; } + /** + * Get the reference + * + * @return mixed + * + * @since 1.0.0 + */ public function getRef() { return $this->ref; } + /** + * Set the list this comment belongs to + * + * @param mixed $list List + * + * @return void + * + * @since 1.0.0 + */ public function setList($list) : void { $this->list = $list; } + /** + * Get the list this comment belongs to + * + * @return mixed + * + * @since 1.0.0 + */ public function getList() { return $this->list; } + /** + * Get the title + * + * @return string + * + * @since 1.0.0 + */ public function getTitle() : string { return $this->title; } + /** + * Set the title + * + * @param string $title Title + * + * @return void + * + * @since 1.0.0 + */ public function setTitle(string $title) : void { $this->title = $title; } + /** + * Get the content + * + * @return string + * + * @since 1.0.0 + */ public function getContent() : string { return $this->content; } + /** + * Get the content + * + * @param string $content Content + * + * @return void + * + * @since 1.0.0 + */ public function setContent(string $content) : void { $this->content = $content; } + /** + * Get the raw content + * + * @return string + * + * @since 1.0.0 + */ public function getContentRaw() : string { return $this->contentRaw; } + /** + * Set the raw content + * + * @param string $contentRaw Content + * + * @return void + * + * @since 1.0.0 + */ public function setContentRaw(string $contentRaw) : void { $this->contentRaw = $contentRaw; @@ -132,6 +212,15 @@ class Comment return $this->createdBy; } + /** + * Set the creator + * + * @param mixed $createdBy Creator + * + * @return void + * + * @since 1.0.0 + */ public function setCreatedBy($createdBy) : void { $this->createdBy = $createdBy; diff --git a/Models/CommentList.php b/Models/CommentList.php index 44726bd..69f669e 100644 --- a/Models/CommentList.php +++ b/Models/CommentList.php @@ -32,7 +32,12 @@ class CommentList */ protected int $id = 0; - private $comments = []; + /** + * + * @var array + * @since 1.0.0 + */ + private array $comments = []; /** * Get id. @@ -46,11 +51,27 @@ class CommentList return $this->id; } + /** + * Get the comments + * + * @return array + * + * @since 1.0.0 + */ public function getComments() : array { return $this->comments; } + /** + * Add a comment + * + * @param mixed $comment Comment + * + * @return void + * + * @since 1.0.0 + */ public function addComment($comment) : void { $this->comments[] = $comment;