Throw IAE again (should never become visible)

pull/11677/head
Roland Häder 2022-06-23 10:03:10 +02:00
parent 35c78ce14c
commit d8ff966d21
No known key found for this signature in database
GPG Key ID: C82EDE5DDFA0BA77
1 changed files with 7 additions and 3 deletions

View File

@ -125,10 +125,11 @@ class Post
/** /**
* Fetch the privacy of the post * Fetch the privacy of the post
* *
* @param array $item * @param array $item Item record
* @return string * @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']) { switch ($item['private']) {
case Item::PRIVATE: case Item::PRIVATE:
@ -142,6 +143,9 @@ class Post
case Item::UNLISTED: case Item::UNLISTED:
$output = DI::l10n()->t('Unlisted Message'); $output = DI::l10n()->t('Unlisted Message');
break; break;
default:
throw new InvalidArgumentException('Item privacy ' . $item['privacy'] . ' is unsupported');
} }
return $output; return $output;