Use/Add explicit `return null;` statement
authorMatthias Schmidt <gravatronics@live.com>
Wed, 12 May 2021 10:25:37 +0000 (12:25 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 12 May 2021 10:25:37 +0000 (12:25 +0200)
files/lib/data/conversation/message/ConversationMessage.class.php
files/lib/system/clipboard/action/ConversationClipboardAction.class.php
files/lib/system/search/ConversationMessageSearch.class.php

index 4746e28fab0f29c328046866514094dc9a315e58..548ae64785ba20b34ebdfd385c2f015f2e3f081d 100644 (file)
@@ -86,7 +86,7 @@ class ConversationMessage extends DatabaseObject implements IMessage
             ]);
 
             if ($ignoreCache && !\count($attachmentList)) {
-                return;
+                return null;
             }
 
             return $attachmentList;
index d1d1ca7ee22720d6818e6003a3c42793d1977c62..e802babfaf8a18837ddd4947f454cd6bac7d1afc 100644 (file)
@@ -54,13 +54,13 @@ class ConversationClipboardAction extends AbstractClipboardAction
 
         // check if no conversation was accessible
         if (empty($this->conversations)) {
-            return;
+            return null;
         }
 
         $item = parent::execute($objects, $action);
 
         if ($item === null) {
-            return;
+            return null;
         }
 
         switch ($action->actionName) {
@@ -73,7 +73,7 @@ class ConversationClipboardAction extends AbstractClipboardAction
                 $statement->execute([WCF::getUser()->userID]);
                 $row = $statement->fetchArray();
                 if ($row['count'] == 0) {
-                    return;
+                    return null;
                 }
 
                 $item->addParameter('objectIDs', \array_keys($this->conversations));
index f8bcaef25a79fc3be21ecc2482c4489d7e744b3e..67d397765caa4369ff30ff08481424afb5d94ae6 100644 (file)
@@ -145,6 +145,8 @@ class ConversationMessageSearch extends AbstractSearchableObjectType
         if ($this->conversation) {
             return 'searchConversationMessage';
         }
+
+        return null;
     }
 
     /**