Simplified the code logic
authorAlexander Ebert <ebert@woltlab.com>
Thu, 28 Apr 2022 14:58:46 +0000 (16:58 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 28 Apr 2022 14:58:46 +0000 (16:58 +0200)
wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php

index 9639571a2b2b4865de07989140cb39e4a10bb789..72902431cd052f548fef534f7f07b72bba6013c9 100644 (file)
@@ -230,21 +230,21 @@ class ViewableModerationQueue extends DatabaseObjectDecorator implements ILinkab
         return WCF::getLanguage()->get('wcf.moderation.type.' . $definition->definitionName);
     }
 
+    /**
+     * @since 5.5
+     */
     public function getIconName(): string
     {
         $definition = ObjectTypeCache::getInstance()->getDefinition(ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID)->definitionID);
 
-        switch ($definition->definitionName) {
-            case 'com.woltlab.wcf.moderation.activation':
-                if ($this->getAffectedObject()->enableTime) {
-                    return 'fa-clock-o';
-                } else {
-                    return 'fa-check-square-o';
-                }
-
-            case 'com.woltlab.wcf.moderation.report':
-            default:
-                return 'fa-exclamation-triangle';
+        if ($definition->definitionName === 'com.woltlab.wcf.moderation.activation') {
+            if ($this->getAffectedObject()->enableTime) {
+                return 'fa-clock-o';
+            } else {
+                return 'fa-check-square-o';
+            }
         }
+
+        return 'fa-exclamation-triangle';
     }
 }