Fix some smaller issues
authorJoshua Rüsweg <josh@bastelstu.be>
Thu, 2 Aug 2018 11:18:34 +0000 (13:18 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Thu, 2 Aug 2018 11:18:34 +0000 (13:18 +0200)
See #2508

wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php
wcfsetup/install/files/lib/data/reaction/type/ReactionTypeCache.class.php

index ede79405db0162df7093fdd685442c13b8da2382..e80d8f0f96c1b1163c84ae2083b3a4b26e51b295 100644 (file)
@@ -226,7 +226,7 @@ class ReactionAction extends AbstractDatabaseObjectAction {
                $likeList->getConditionBuilder()->add("like_table.reactionTypeID = ?", [$this->parameters['reactionTypeID']]);
                $likeList->readObjects();
                
-               if (!count($likeList)) {
+               if (empty($likeList)) {
                        return [];
                }
                
index ea8e0f8c98e0afd851d8ccf7ca13fa2faf5f6cfd..3f1b11c69224f7d175c6a8b1ecc2a6b96c6d55c9 100644 (file)
@@ -28,7 +28,7 @@ class ReactionTypeCache extends SingletonFactory {
        /**
         * @inheritDoc
         */
-       public function init() {
+       protected function init() {
                $this->reactionTypes = ReactionTypeCacheBuilder::getInstance()->getData();
                $this->enabledReactionTypes = ReactionTypeCacheBuilder::getInstance()->getData(['onlyEnabled' => 1]);
        }
@@ -36,12 +36,12 @@ class ReactionTypeCache extends SingletonFactory {
        /**
         * Returns the reaction type with the given reactionTypeID.
         *
-        * @param       integer         $trophyID
+        * @param       integer         $reactionTypeID
         * @return      ReactionType
         */
-       public function getReactionTypeByID($trophyID) {
-               if (isset($this->reactionTypes[$trophyID])) {
-                       return $this->reactionTypes[$trophyID];
+       public function getReactionTypeByID($reactionTypeID) {
+               if (isset($this->reactionTypes[$reactionTypeID])) {
+                       return $this->reactionTypes[$reactionTypeID];
                }
                
                return null;