]> git.mxchange.org Git - friendica.git/commitdiff
Throw IAE again (should never become visible)
authorRoland Häder <roland@mxchange.org>
Thu, 23 Jun 2022 08:03:10 +0000 (10:03 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 23 Jun 2022 15:30:13 +0000 (17:30 +0200)
src/Object/Post.php

index 90b74d4dd18a2622bc942c88fac2a858bcad4f83..f8bca15be5a0279af8a8f5af1d8ded80b6512010 100644 (file)
@@ -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;