diff --git a/files/lib/acp/form/CommandTriggerAddForm.class.php b/files/lib/acp/form/CommandTriggerAddForm.class.php index 32f23f6..fb473b1 100644 --- a/files/lib/acp/form/CommandTriggerAddForm.class.php +++ b/files/lib/acp/form/CommandTriggerAddForm.class.php @@ -101,7 +101,7 @@ public function validate() { parent::validate(); - if (empty($this->commandTrigger)) { + if ($this->commandTrigger === '') { throw new UserInputException('commandTrigger', 'empty'); } @@ -119,7 +119,7 @@ public function validate() throw new UserInputException('commandTrigger', 'duplicate'); } - if (empty($this->className)) { + if ($this->className === '') { throw new UserInputException('className', 'empty'); } diff --git a/files/lib/acp/form/RoomAddForm.class.php b/files/lib/acp/form/RoomAddForm.class.php index 82d14d6..5d3b8ae 100644 --- a/files/lib/acp/form/RoomAddForm.class.php +++ b/files/lib/acp/form/RoomAddForm.class.php @@ -225,7 +225,7 @@ public function saveI18nValue(Room $room, $columns) } } - if (!empty($data)) { + if ($data !== []) { (new RoomEditor($room))->update($data); } } diff --git a/files/lib/acp/page/SuspensionListPage.class.php b/files/lib/acp/page/SuspensionListPage.class.php index 24307c9..1f142eb 100644 --- a/files/lib/acp/page/SuspensionListPage.class.php +++ b/files/lib/acp/page/SuspensionListPage.class.php @@ -149,7 +149,7 @@ public function readParameters() if (isset($_POST['searchUsername'])) { $this->searchUsername = StringUtil::trim($_POST['searchUsername']); - if (!empty($this->searchUsername)) { + if ($this->searchUsername !== '') { $this->userID = User::getUserByUsername($this->searchUsername)->userID; } } elseif ($this->userID !== null) { @@ -159,7 +159,7 @@ public function readParameters() if (isset($_POST['searchJudge'])) { $this->searchJudge = StringUtil::trim($_POST['searchJudge']); - if (!empty($this->searchJudge)) { + if ($this->searchJudge !== '') { $this->judgeID = User::getUserByUsername($this->searchJudge)->userID; } } elseif ($this->judgeID !== null) { diff --git a/files/lib/data/message/MessageAction.class.php b/files/lib/data/message/MessageAction.class.php index 72a7dce..d97398c 100644 --- a/files/lib/data/message/MessageAction.class.php +++ b/files/lib/data/message/MessageAction.class.php @@ -333,7 +333,7 @@ public function pull() return $message->hasEmbeddedObjects; })); - if (!empty($embeddedObjectMessageIDs)) { + if ($embeddedObjectMessageIDs !== []) { // load embedded objects MessageEmbeddedObjectManager::getInstance()->loadObjects('be.bastelstu.chat.message', $embeddedObjectMessageIDs); } diff --git a/files/lib/data/message/MessageEditor.class.php b/files/lib/data/message/MessageEditor.class.php index de3c263..a6f5c02 100644 --- a/files/lib/data/message/MessageEditor.class.php +++ b/files/lib/data/message/MessageEditor.class.php @@ -37,7 +37,7 @@ public static function deleteAll(array $messageIDs = []) WCF::getDB()->beginTransaction(); $result = parent::deleteAll($messageIDs); - if (!empty($messageIDs)) { + if ($messageIDs !== []) { AttachmentHandler::removeAttachments('be.bastelstu.chat.message', $messageIDs); } diff --git a/files/lib/data/user/UserAction.class.php b/files/lib/data/user/UserAction.class.php index ffabde3..c281454 100644 --- a/files/lib/data/user/UserAction.class.php +++ b/files/lib/data/user/UserAction.class.php @@ -88,7 +88,7 @@ public function getUsersByID() public function clearDeadSessions() { $sessions = User::getDeadSessions(); - if (empty($sessions)) { + if ($sessions !== []) { return; } $userIDs = \array_map(static function ($item) { diff --git a/files/lib/system/event/listener/HourlyCleanUpCronjobExecuteTemproomListener.class.php b/files/lib/system/event/listener/HourlyCleanUpCronjobExecuteTemproomListener.class.php index c8d67a3..d945fd5 100644 --- a/files/lib/system/event/listener/HourlyCleanUpCronjobExecuteTemproomListener.class.php +++ b/files/lib/system/event/listener/HourlyCleanUpCronjobExecuteTemproomListener.class.php @@ -41,7 +41,7 @@ public function execute($eventObj, $className, $eventName, array &$parameters) $toDelete[] = $room; } } - if (!empty($toDelete)) { + if ($toDelete !== []) { (new RoomAction( $toDelete, 'delete' diff --git a/files/lib/system/event/listener/RoomCanJoinBanListener.class.php b/files/lib/system/event/listener/RoomCanJoinBanListener.class.php index 4f4dd6a..40a5bd2 100644 --- a/files/lib/system/event/listener/RoomCanJoinBanListener.class.php +++ b/files/lib/system/event/listener/RoomCanJoinBanListener.class.php @@ -42,7 +42,7 @@ public function execute($eventObj, $className, $eventName, array &$parameters) $parameters['user']->getDecoratedObject(), $eventObj ); - if (!empty($suspensions)) { + if ($suspensions !== []) { $parameters['result'] = new PermissionDeniedException( WCF::getLanguage()->getDynamicVariable('chat.suspension.info.be.bastelstu.chat.suspension.ban') ); diff --git a/files/lib/system/event/listener/RoomCanWritePubliclyMuteListener.class.php b/files/lib/system/event/listener/RoomCanWritePubliclyMuteListener.class.php index 96af6d4..1a017ea 100644 --- a/files/lib/system/event/listener/RoomCanWritePubliclyMuteListener.class.php +++ b/files/lib/system/event/listener/RoomCanWritePubliclyMuteListener.class.php @@ -42,7 +42,7 @@ public function execute($eventObj, $className, $eventName, array &$parameters) $parameters['user']->getDecoratedObject(), $eventObj ); - if (!empty($suspensions)) { + if ($suspensions !== []) { $parameters['result'] = new PermissionDeniedException( WCF::getLanguage()->getDynamicVariable('chat.suspension.info.be.bastelstu.chat.suspension.mute') ); diff --git a/files/lib/system/page/handler/RoomListPageHandler.class.php b/files/lib/system/page/handler/RoomListPageHandler.class.php index b424085..141eb2b 100644 --- a/files/lib/system/page/handler/RoomListPageHandler.class.php +++ b/files/lib/system/page/handler/RoomListPageHandler.class.php @@ -36,7 +36,7 @@ public function getOutstandingItemCount($objectID = null): int return $room->canSee(); })); - if (empty($users)) { + if ($users === []) { return 0; }