From d8ff966d21cbf73944ceefc789a91563d5e1e469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Thu, 23 Jun 2022 10:03:10 +0200 Subject: [PATCH] Throw IAE again (should never become visible) --- src/Object/Post.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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;