phpcs fixes

This commit is contained in:
Dennis Eichhorn 2019-10-06 17:50:12 +02:00
parent 1176c87de3
commit 8b700d9e30
7 changed files with 69 additions and 11 deletions

View File

@ -91,6 +91,15 @@ final class BackendController extends Controller
return $view; return $view;
} }
/**
* Validate comment create request
*
* @param RequestAbstract $request Request
*
* @return array<string, bool> Returns the validation array of the request
*
* @since 1.0.0
*/
private function validateCommentCreate(RequestAbstract $request) : array private function validateCommentCreate(RequestAbstract $request) : array
{ {
$val = []; $val = [];

View File

@ -24,7 +24,13 @@ namespace Modules\Comments\Models;
*/ */
class Comment class Comment
{ {
private $id = 0; /**
* ID.
*
* @var int
* @since 1.0.0
*/
protected int $id = 0;
private $createdBy = 0; private $createdBy = 0;
@ -34,7 +40,7 @@ class Comment
private $title = ''; private $title = '';
private $status = 0; private int $status = 0;
private $content = ''; private $content = '';
@ -42,11 +48,23 @@ class Comment
private $ref = null; private $ref = null;
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct() public function __construct()
{ {
$this->createdAt = new \DateTime(); $this->createdAt = new \DateTime();
} }
/**
* Get id.
*
* @return int Model id
*
* @since 1.0.0
*/
public function getId() : int public function getId() : int
{ {
return $this->id; return $this->id;
@ -102,6 +120,13 @@ class Comment
$this->contentRaw = $contentRaw; $this->contentRaw = $contentRaw;
} }
/**
* Get created by
*
* @return int|\phpOMS\Account\Account
*
* @since 1.0.0
*/
public function getCreatedBy() public function getCreatedBy()
{ {
return $this->createdBy; return $this->createdBy;
@ -112,6 +137,13 @@ class Comment
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
} }
/**
* 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

@ -24,14 +24,23 @@ namespace Modules\Comments\Models;
*/ */
class CommentList class CommentList
{ {
private $id = 0; /**
* ID.
*
* @var int
* @since 1.0.0
*/
protected int $id = 0;
private $comments = []; private $comments = [];
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;

View File

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

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 ['Comments' => [ return ['Comments' => [
'Created' => 'Created', 'Created' => 'Created',
'Creator' => 'Creator', 'Creator' => 'Creator',

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);
/** /**
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
*/ */

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);
/** /**
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
*/ */