From: Roland Häder Date: Thu, 23 Jun 2022 08:03:10 +0000 (+0200) Subject: Throw IAE again (should never become visible) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d8ff966d21cbf73944ceefc789a91563d5e1e469;p=friendica.git Throw IAE again (should never become visible) --- diff --git a/src/Object/Post.php b/src/Object/Post.php index 90b74d4dd1..f8bca15be5 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -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;