]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Post.php
Superfluous todo removed
[friendica.git] / src / Object / Post.php
index 63ac91904cd75899b91d784247a9e1653f53d715..fe271b5a87afae50ea6ba75a95923085b440ef18 100644 (file)
@@ -106,7 +106,7 @@ class Post
                                // Only add will be displayed
                                if ($item['network'] === Protocol::MAIL && local_user() != $item['uid']) {
                                        continue;
-                               } elseif (!DI::contentItem()->visibleActivity($item)) {
+                               } elseif (!DI::contentItem()->isVisibleActivity($item)) {
                                        continue;
                                }
 
@@ -125,10 +125,11 @@ class Post
        /**
         * Fetch the privacy of the post
         *
-        * @param array $item
-        * @return string
+        * @param array $item Item record
+        * @return string Item privacy message
+        * @throws InvalidArgumentException If $item['private'] is unknown
         */
-       private function fetchPrivacy(array $item):string
+       private function fetchPrivacy(array $item): string
        {
                switch ($item['private']) {
                        case Item::PRIVATE:
@@ -142,6 +143,9 @@ class Post
                        case Item::UNLISTED:
                                $output = DI::l10n()->t('Unlisted Message');
                                break;
+
+                       default:
+                               throw new InvalidArgumentException('Item privacy ' . $item['privacy'] . ' is unsupported');
                }
 
                return $output;
@@ -743,7 +747,7 @@ class Post
        /**
         * Set conversation thread
         *
-        * @param Thread $thread
+        * @param Thread|null $thread
         * @return void
         */
        public function setThread(Thread $thread = null)
@@ -759,9 +763,9 @@ class Post
        /**
         * Get conversation
         *
-        * @return Thread
+        * @return Thread|null
         */
-       public function getThread(): Thread
+       public function getThread()
        {
                return $this->thread;
        }