cleanup and tests added for ci/cd

This commit is contained in:
Dennis Eichhorn 2019-11-20 22:28:04 +01:00
parent 725acd6609
commit 896647e6fe
4 changed files with 302 additions and 1 deletions

View File

@ -105,21 +105,53 @@ class KanbanBoard implements \JsonSerializable
$this->name = $name;
}
/**
* Get the status
*
* @return int
*
* @since 1.0.0
*/
public function getStatus() : int
{
return $this->status;
}
/**
* Set the status
*
* @param int $status Status
*
* @return void
*
* @since 1.0.0
*/
public function setStatus(int $status) : void
{
$this->status = $status;
}
/**
* Get the order
*
* @return int
*
* @since 1.0.0
*/
public function getOrder() : int
{
return $this->order;
}
/**
* Set the order
*
* @param int $order Order
*
* @return void
*
* @since 1.0.0
*/
public function setOrder(int $order) : void
{
$this->order = $order;
@ -189,16 +221,41 @@ class KanbanBoard implements \JsonSerializable
return $this->createdAt;
}
/**
* Get the columns
*
* @return array
*
* @since 1.0.0
*/
public function getColumns() : array
{
return $this->columns;
}
/**
* Add a column
*
* @param mixed $column Column
*
* @return void
*
* @since 1.0.0
*/
public function addColumn($column) : void
{
$this->columns[] = $column;
}
/**
* Remove a column
*
* @param int $id Id to remove
*
* @return bool
*
* @since 1.0.0
*/
public function removeColumn(int $id) : bool
{
if (isset($this->columns[$id])) {

View File

@ -14,8 +14,10 @@ declare(strict_types=1);
namespace Modules\Kanban\Models;
use Modules\Tasks\Models\Task;
/**
* Task class.
* Kanban card class.
*
* @package Modules\Kanban\Models
* @license OMS License 1.0
@ -77,11 +79,27 @@ class KanbanCard implements \JsonSerializable
$this->createdAt = new \DateTime('now');
}
/**
* Get the order
*
* @return int
*
* @since 1.0.0
*/
public function getOrder() : int
{
return $this->order;
}
/**
* Set the order
*
* @param int $order Order
*
* @return void
*
* @since 1.0.0
*/
public function setOrder(int $order) : void
{
$this->order = $order;
@ -99,11 +117,27 @@ class KanbanCard implements \JsonSerializable
return $this->id;
}
/**
* Set the column
*
* @param int $id Id
*
* @return void
*
* @since 1.0.0
*/
public function setColumn(int $id) : void
{
$this->column = $id;
}
/**
* Get the column
*
* @return int
*
* @since 1.0.0
*/
public function getColumn() : int
{
return $this->column;
@ -135,31 +169,79 @@ class KanbanCard implements \JsonSerializable
$this->name = $name;
}
/**
* Get the status
*
* @return int
*
* @since 1.0.0
*/
public function getStatus() : int
{
return $this->status;
}
/**
* Set the status
*
* @param int $status Status
*
* @return void
*
* @since 1.0.0
*/
public function setStatus(int $status) : void
{
$this->status = $status;
}
/**
* Get the card type
*
* @return int
*
* @since 1.0.0
*/
public function getType() : int
{
return $this->type;
}
/**
* Set the card type
*
* @param int $type Card type
*
* @return void
*
* @since 1.0.0
*/
public function setType(int $type) : void
{
$this->type = $type;
}
/**
* Get the reference if the card references another object (e.g. task, calendar etc.)
*
* @return int
*
* @since 1.0.0
*/
public function getRef() : int
{
return $this->ref;
}
/**
* Set the reference
*
* @param int $ref Reference
*
* @return void
*
* @since 1.0.0
*/
public function setRef(int $ref) : void
{
$this->ref = $ref;
@ -229,16 +311,41 @@ class KanbanCard implements \JsonSerializable
return $this->createdAt;
}
/**
* 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;
}
/**
* Remove a comment
*
* @param int $id Comment id
*
* @return bool
*
* @since 1.0.0
*/
public function removeComment(int $id) : bool
{
if (isset($this->comments[$id])) {
@ -250,26 +357,65 @@ class KanbanCard implements \JsonSerializable
return false;
}
/**
* Get the media files
*
* @return array
*
* @since 1.0.0
*/
public function getMedia() : array
{
return $this->media;
}
/**
* Add a media file
*
* @return void
*
* @since 1.0.0
*/
public function addMedia($media) : void
{
$this->media[] = $media;
}
/**
* Set labels of the card
*
* @param array $labels Labels
*
* @return void
*
* @since 1.0.0
*/
public function setLabels(array $labels) : void
{
$this->labels = $labels;
}
/**
* Get the labels
*
* @return array
*
* @since 1.0.0
*/
public function getLabels() : array
{
return $this->labels;
}
/**
* Add a label/tag
*
* @param mixed $label Label
*
* @return void
*
* @since 1.0.0
*/
public function addLabel($label) : void
{
$this->labels[] = $label;
@ -296,6 +442,15 @@ class KanbanCard implements \JsonSerializable
];
}
/**
* Create a task from a card
*
* @param Task $task Task to create the card from
*
* @return KanbanCard
*
* @since 1.0.0
*/
public static function createFromTask(Task $task) : self
{
$card = new self();

View File

@ -69,11 +69,27 @@ class KanbanCardComment implements \JsonSerializable
return $this->id;
}
/**
* Set the card
*
* @param int $id Card id
*
* @return void
*
* @since 1.0.0
*/
public function setCard(int $id) : void
{
$this->card = $id;
}
/**
* Get the card
*
* @return int
*
* @since 1.0.0
*/
public function getCard() : int
{
return $this->card;
@ -143,11 +159,27 @@ class KanbanCardComment implements \JsonSerializable
return $this->createdAt;
}
/**
* Get the media files
*
* @return array
*
* @since 1.0.0
*/
public function getMedia() : array
{
return $this->media;
}
/**
* Add a media file
*
* @param mixed $media Media
*
* @return void
*
* @since 1.0.0
*/
public function addMedia($media) : void
{
$this->media[] = $media;

View File

@ -58,21 +58,53 @@ class KanbanColumn implements \JsonSerializable
return $this->id;
}
/**
* Get the order
*
* @return int
*
* @since 1.0.0
*/
public function getOrder() : int
{
return $this->order;
}
/**
* Set the order
*
* @param int $order Order
*
* @return void
*
* @since 1.0.0
*/
public function setOrder(int $order) : void
{
$this->order = $order;
}
/**
* Get the board this column belongs to
*
* @param int $board Board
*
* @return void
*
* @since 1.0.0
*/
public function setBoard(int $board) : void
{
$this->board = $board;
}
/**
* Get the board this column belongs to
*
* @return int
*
* @since 1.0.0
*/
public function getBoard() : int
{
return $this->board;
@ -104,16 +136,41 @@ class KanbanColumn implements \JsonSerializable
$this->name = $name;
}
/**
* Get the cards
*
* @return array
*
* @since 1.0.0
*/
public function getCards() : array
{
return $this->cards;
}
/**
* Add a card
*
* @param KanbanCard $card Card
*
* @return void
*
* @since 1.0.0
*/
public function addCard(KanbanCard $card) : void
{
$this->cards[] = $card;
}
/**
* Remove a card
*
* @param int $id Card to remove
*
* @return bool
*
* @since 1.0.0
*/
public function removeCard(int $id) : bool
{
if (isset($this->cards[$id])) {