]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/shownotice.php
Stronger typing for NoticeListItem and so
[quix0rs-gnu-social.git] / actions / shownotice.php
index 28cb68c121f224c9b1b93f4c3f5eb09ba1d212bd..5e2be9f9d2b2ff48c685026779178a76e3b6e157 100644 (file)
@@ -114,20 +114,19 @@ class ShownoticeAction extends Action
         $id = $this->arg('notice');
 
         $notice = Notice::getKV('id', $id);
+        if ($notice instanceof Notice) {
+            // Alright, got it!
+            return $notice;
+        }
 
-        if (!$notice instanceof Notice) {
-            // Did we used to have it, and it got deleted?
-            $deleted = Deleted_notice::getKV($id);
-            if ($deleted instanceof Deleted_notice) {
-                // TRANS: Client error displayed trying to show a deleted notice.
-                $this->clientError(_('Notice deleted.'), 410);
-            } else {
-                // TRANS: Client error displayed trying to show a non-existing notice.
-                $this->clientError(_('No such notice.'), 404);
-            }
-            return false;
+        // Did we use to have it, and it got deleted?
+        $deleted = Deleted_notice::getKV('id', $id);
+        if ($deleted instanceof Deleted_notice) {
+            // TRANS: Client error displayed trying to show a deleted notice.
+            $this->clientError(_('Notice deleted.'), 410);
         }
-        return $notice;
+        // TRANS: Client error displayed trying to show a non-existing notice.
+        $this->clientError(_('No such notice.'), 404);
     }
 
     /**