// 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;
}
/**
* 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:
case Item::UNLISTED:
$output = DI::l10n()->t('Unlisted Message');
break;
+
+ default:
+ throw new InvalidArgumentException('Item privacy ' . $item['privacy'] . ' is unsupported');
}
return $output;
/**
* Set conversation thread
*
- * @param Thread $thread
+ * @param Thread|null $thread
* @return void
*/
public function setThread(Thread $thread = null)
/**
* Get conversation
*
- * @return Thread
+ * @return Thread|null
*/
- public function getThread(): Thread
+ public function getThread()
{
return $this->thread;
}