From 92c0f71ed65775e773c706c052f94ed35276a42c Mon Sep 17 00:00:00 2001 From: Vassyli Date: Wed, 10 Jan 2018 08:22:28 +0100 Subject: [PATCH] Small clean-ups --- src/Models/GameConfiguration.php | 4 ++-- src/Models/Message.php | 5 +++-- src/Models/MessageThread.php | 6 +++--- src/Models/Module.php | 5 +++-- src/Models/MotD.php | 6 +++--- src/Models/Permission.php | 1 + 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Models/GameConfiguration.php b/src/Models/GameConfiguration.php index 84a7dbb..e69ff25 100644 --- a/src/Models/GameConfiguration.php +++ b/src/Models/GameConfiguration.php @@ -21,7 +21,7 @@ class GameConfiguration /** * Constructor. - * @param EntityManagerInterface $em + * @param EntityManagerInterface $entityManager */ public function __construct(EntityManagerInterface $entityManager) { @@ -42,7 +42,7 @@ class GameConfiguration /** * Sets and overwrites a configuration value saved by the name * @param string $configurationName - * @param type $configurationValue + * @param mixed $configurationValue */ public function set(string $configurationName, $configurationValue) { diff --git a/src/Models/Message.php b/src/Models/Message.php index e1b9e17..adf9dab 100644 --- a/src/Models/Message.php +++ b/src/Models/Message.php @@ -11,6 +11,7 @@ use Doctrine\ORM\Mapping\Table; use LotGD\Core\Exceptions\InvalidModelException; use LotGD\Core\Exceptions\ArgumentException; +use LotGD\Core\Exceptions\ParentAlreadySetException; use LotGD\Core\Tools\Model\Deletor; use LotGD\Core\Tools\Model\Saveable; @@ -72,9 +73,9 @@ class Message * * This method has been made protected to prevent from accessing it directly. Use * the static methods self::send() and self::sendSystemMessage() instead. - * @param \LotGD\Core\Models\Character $from + * @param CharacterInterface $from * @param string $message - * @param \LotGD\Core\Models\Thread $thread + * @param MessageThread $thread * @param bool $systemMessage * @throws ArgumentException */ diff --git a/src/Models/MessageThread.php b/src/Models/MessageThread.php index e907316..8d93f22 100644 --- a/src/Models/MessageThread.php +++ b/src/Models/MessageThread.php @@ -36,10 +36,10 @@ class MessageThread implements SaveableInterface /** * Constructor. Sets the (unique) threadKey. * @param string $threadKey - * @param type $participants - * @param type $readonly + * @param array $participants + * @param bool $readonly */ - public function __construct(string $threadKey, array $participants, $readonly = false) + public function __construct(string $threadKey, array $participants, bool $readonly = false) { $this->threadKey = $threadKey; $this->readonly = $readonly; diff --git a/src/Models/Module.php b/src/Models/Module.php index c8ee651..d469a42 100644 --- a/src/Models/Module.php +++ b/src/Models/Module.php @@ -3,6 +3,7 @@ declare(strict_types=1); namespace LotGD\Core\Models; +use DateTime; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\Table; use Doctrine\Common\Collections\ArrayCollection; @@ -39,7 +40,7 @@ class Module implements SaveableInterface public function __construct(string $library) { $this->properties = new ArrayCollection(); - $this->createdAt = new \DateTime(); + $this->createdAt = new DateTime(); $this->library = $library; } @@ -47,7 +48,7 @@ class Module implements SaveableInterface * Returns the time this module was added to the system. * @return DateTime */ - public function getCreatedAt(): \DateTime + public function getCreatedAt(): DateTime { return $this->createdAt; } diff --git a/src/Models/MotD.php b/src/Models/MotD.php index 8ac989c..c424f4f 100644 --- a/src/Models/MotD.php +++ b/src/Models/MotD.php @@ -67,7 +67,7 @@ class MotD implements CreateableInterface * Returns always the real author of the message, even if it is a * system message. Use $this->getSystemMessage() to check if it is a system * message or $this->getAppearentAuthor() to get the appearent author. - * @return \LotGD\Core\Models\Character + * @return CharacterInterface */ public function getAuthor(): CharacterInterface { @@ -76,7 +76,7 @@ class MotD implements CreateableInterface /** * Returns the appearent author of this message. - * @return \LotGD\Core\Models\CharacterInterface + * @return CharacterInterface */ public function getApparantAuthor(): CharacterInterface { @@ -89,7 +89,7 @@ class MotD implements CreateableInterface /** * Sets the author of this motd - * @param \LotGD\Core\Models\Character $author + * @param Character $author */ public function setAuthor(Character $author) { diff --git a/src/Models/Permission.php b/src/Models/Permission.php index 5e7915f..33417a1 100644 --- a/src/Models/Permission.php +++ b/src/Models/Permission.php @@ -46,6 +46,7 @@ class Permission implements CreateableInterface /** * Sets this entity's id if it's not set yet. * @param string $id + * @throws ArgumentException */ public function setId(string $id) {