phpcs fixes

This commit is contained in:
Dennis Eichhorn 2019-10-06 17:50:12 +02:00
parent 2982e881d4
commit f888d66c22
6 changed files with 116 additions and 16 deletions

View File

@ -24,26 +24,56 @@ namespace Modules\Knowledgebase\Models;
*/ */
class WikiCategory implements \JsonSerializable class WikiCategory implements \JsonSerializable
{ {
private $id = 0; /**
* ID.
private $name = ''; *
* @var int
* @since 1.0.0
*/
protected int $id = 0;
/**
* Name.
*
* @var string
* @since 1.0.0
*/
private string $name = '';
private $parent = null; private $parent = null;
public function __construct() /**
{ * Get id.
} *
* @return int Model id
*
* @since 1.0.0
*/
public function getId() : int public function getId() : int
{ {
return $this->id; return $this->id;
} }
/**
* Get name
*
* @return string
*
* @since 1.0.0
*/
public function getName() : string public function getName() : string
{ {
return $this->name; return $this->name;
} }
/**
* Set name
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName(string $name) : void public function setName(string $name) : void
{ {
$this->name = $name; $this->name = $name;

View File

@ -24,11 +24,22 @@ namespace Modules\Knowledgebase\Models;
*/ */
class WikiDoc implements \JsonSerializable 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 int $status = WikiStatus::ACTIVE;
private $status = WikiStatus::ACTIVE;
private $doc = ''; private $doc = '';
@ -42,11 +53,23 @@ class WikiDoc implements \JsonSerializable
private $badges = []; private $badges = [];
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct() public function __construct()
{ {
$this->createdAt = new \DateTime('now'); $this->createdAt = new \DateTime('now');
} }
/**
* Get id.
*
* @return int Model id
*
* @since 1.0.0
*/
public function getId() : int public function getId() : int
{ {
return $this->id; return $this->id;
@ -62,11 +85,27 @@ class WikiDoc implements \JsonSerializable
$this->language = $language; $this->language = $language;
} }
/**
* Get name
*
* @return string
*
* @since 1.0.0
*/
public function getName() : string public function getName() : string
{ {
return $this->name; return $this->name;
} }
/**
* Set name
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName(string $name) : void public function setName(string $name) : void
{ {
$this->name = $name; $this->name = $name;
@ -102,16 +141,39 @@ class WikiDoc implements \JsonSerializable
$this->category = $category; $this->category = $category;
} }
/**
* Get created by
*
* @return int|\phpOMS\Account\Account
*
* @since 1.0.0
*/
public function getCreatedBy() : int public function getCreatedBy() : int
{ {
return $this->createdBy; 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; $this->createdBy = $id;
} }
/**
* Get created at date time
*
* @return \DateTime
*
* @since 1.0.0
*/
public function getCreatedAt() : \DateTime public function getCreatedAt() : \DateTime
{ {
return $this->createdAt; return $this->createdAt;

View File

@ -1,4 +1,4 @@
<?php declare(strict_types=1); <?php
/** /**
* Orange Management * Orange Management
* *
@ -10,6 +10,8 @@
* @version 1.0.0 * @version 1.0.0
* @link https://orange-management.org * @link https://orange-management.org
*/ */
declare(strict_types=1);
return ['Navigation' => [ return ['Navigation' => [
'Wiki' => 'Wiki', 'Wiki' => 'Wiki',
]]; ]];

View File

@ -1,4 +1,4 @@
<?php declare(strict_types=1); <?php
/** /**
* Orange Management * Orange Management
* *
@ -10,6 +10,8 @@
* @version 1.0.0 * @version 1.0.0
* @link https://orange-management.org * @link https://orange-management.org
*/ */
declare(strict_types=1);
return ['Knowledgebase' => [ return ['Knowledgebase' => [
'Categories' => 'Categories', 'Categories' => 'Categories',
'Name' => 'Name', 'Name' => 'Name',

View File

@ -1,4 +1,4 @@
<?php declare(strict_types=1); <?php
/** /**
* Orange Management * Orange Management
* *
@ -10,6 +10,8 @@
* @version 1.0.0 * @version 1.0.0
* @link https://orange-management.org * @link https://orange-management.org
*/ */
declare(strict_types=1);
$categories = $this->getData('categories'); $categories = $this->getData('categories');

View File

@ -1,7 +1,9 @@
<?php declare(strict_types=1); <?php
/** /**
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
*/ */
declare(strict_types=1);
echo $this->getData('nav')->render(); echo $this->getData('nav')->render();
?> ?>