/**
* @inheritDoc
*/
- public function getTitle()
+ public function getTitle(): string
{
return $this->subject;
}
/**
* @inheritDoc
*/
- public function getLink()
+ public function getLink(): string
{
return LinkHandler::getInstance()->getLink('Conversation', [
'object' => $this,
/**
* Returns true if this conversation is new for the active user.
- *
- * @return bool
*/
- public function isNew()
+ public function isNew(): bool
{
if (!$this->isDraft && $this->lastPostTime > $this->lastVisitTime) {
return true;
/**
* Returns true if the active user doesn't have read the given message.
- *
- * @param ConversationMessage $message
- * @return bool
*/
- public function isNewMessage(ConversationMessage $message)
+ public function isNewMessage(ConversationMessage $message): bool
{
if (!$this->isDraft && $message->time > $this->lastVisitTime) {
return true;
/**
* Returns true if the conversation is not closed or the user was not removed.
- *
- * @return bool
*/
- public function canReply()
+ public function canReply(): bool
{
if (!$this->canRead()) {
return false;
/**
* Returns true if the active user has the permission to read this conversation.
- *
- * @return bool
*/
- public function canRead()
+ public function canRead(): bool
{
if (!WCF::getUser()->userID) {
return false;
/**
* Returns true if the current user can add new participants to this conversation.
- *
- * @return bool
*/
- public function canAddParticipants()
+ public function canAddParticipants(): bool
{
if ($this->isDraft) {
return false;
/**
* Returns true if the current user can add participants without limitations.
- *
- * @return bool
*/
- public function canAddParticipantsUnrestricted()
+ public function canAddParticipantsUnrestricted(): bool
{
if ($this->canAddUnrestricted === null) {
$this->canAddUnrestricted = false;
/**
* Returns false if the active user is the last participant of this conversation.
- *
- * @return bool
*/
- public function hasOtherParticipants()
+ public function hasOtherParticipants(): bool
{
if ($this->userID == WCF::getUser()->userID) {
// author
/**
* Returns true if the current user is an active participant of this conversation.
- *
- * @return bool
*/
- public function isActiveParticipant()
+ public function isActiveParticipant(): bool
{
if ($this->isActiveParticipant === null) {
$sql = "SELECT leftAt
/**
* @inheritDoc
*/
- public function getPopoverLinkClass()
+ public function getPopoverLinkClass(): string
{
return 'conversationLink';
}
*
* @param int[] $conversationIDs
* @param int $userID
- * @return bool
*/
- public static function isParticipant(array $conversationIDs, $userID = null)
+ public static function isParticipant(array $conversationIDs, $userID = null): bool
{
if ($userID === null) {
$userID = WCF::getUser()->userID;
/**
* @inheritDoc
*/
- public function getLink()
+ public function getLink(): string
{
return LinkHandler::getInstance()->getLink('Conversation', [
'object' => $this->getDecoratedObject(),
/**
* @inheritDoc
*/
- public function getTitle()
+ public function getTitle(): string
{
return $this->getDecoratedObject()->getTitle();
}
/**
* @inheritDoc
*/
- public function getFormattedMessage()
+ public function getFormattedMessage(): string
{
return '';
}
/**
* @inheritDoc
*/
- public function getMessage()
+ public function getMessage(): string
{
return '';
}
/**
* @inheritDoc
*/
- public function getExcerpt($maxLength = 255)
+ public function getExcerpt($maxLength = 255): string
{
return '';
}
/**
* @inheritDoc
*/
- public function getUsername()
+ public function getUsername(): string
{
return $this->getDecoratedObject()->lastPoster;
}
/**
* @inheritDoc
*/
- public function __toString()
+ public function __toString(): string
{
return $this->getFormattedMessage();
}
/**
* @inheritDoc
*/
- public function getFormattedMessage()
+ public function getFormattedMessage(): string
{
$processor = new HtmlOutputProcessor();
$processor->process($this->message, 'com.woltlab.wcf.conversation.message', $this->messageID);
/**
* Returns a simplified version of the formatted message.
- *
- * @return string
*/
- public function getSimplifiedFormattedMessage()
+ public function getSimplifiedFormattedMessage(): string
{
$processor = new HtmlOutputProcessor();
$processor->setOutputType('text/simplified-html');
/**
* @inheritDoc
*/
- public function getExcerpt($maxLength = 255)
+ public function getExcerpt($maxLength = 255): string
{
return StringUtil::truncateHTML($this->getSimplifiedFormattedMessage(), $maxLength);
}
* Returns a version of this message optimized for use in emails.
*
* @param string $mimeType Either 'text/plain' or 'text/html'
- * @return string
*/
- public function getMailText($mimeType = 'text/plain')
+ public function getMailText($mimeType = 'text/plain'): string
{
switch ($mimeType) {
case 'text/plain':
/**
* Returns true if current user may edit this message.
- *
- * @return bool
*/
- public function canEdit()
+ public function canEdit(): bool
{
return WCF::getUser()->userID == $this->userID
&& (
/**
* @inheritDoc
*/
- public function getMessage()
+ public function getMessage(): string
{
return $this->message;
}
/**
* @inheritDoc
*/
- public function getLink()
+ public function getLink(): string
{
return LinkHandler::getInstance()->getLink('Conversation', [
'object' => $this->getConversation(),
/**
* @inheritDoc
*/
- public function getTitle()
+ public function getTitle(): string
{
if ($this->messageID == $this->getConversation()->firstMessageID) {
return $this->getConversation()->subject;
/**
* @inheritDoc
*/
- public function isVisible()
+ public function isVisible(): bool
{
return true;
}
/**
* @inheritDoc
*/
- public function __toString()
+ public function __toString(): string
{
return $this->getFormattedMessage();
}
/**
* @inheritDoc
*/
- public function getTitle()
+ public function getTitle(): string
{
$count = \count($this->getAuthors());
if ($count > 1) {
/**
* @inheritDoc
*/
- public function getMessage()
+ public function getMessage(): string
{
$authors = \array_values($this->getAuthors());
$count = \count($authors);
* @inheritDoc
* @since 5.2
*/
- public function getEmailTitle()
+ public function getEmailTitle(): string
{
if (\count($this->getAuthors()) > 1) {
return parent::getEmailTitle();
/**
* @inheritDoc
*/
- public function getLink()
+ public function getLink(): string
{
return $this->getUserNotificationObject()->getLink();
}
/**
* @inheritDoc
*/
- public function getEventHash()
+ public function getEventHash(): string
{
return \sha1($this->eventID . '-' . $this->getUserNotificationObject()->conversationID);
}
/**
* @inheritDoc
*/
- public function checkAccess()
+ public function checkAccess(): bool
{
return $this->getUserNotificationObject()->getConversation()->canRead();
}
/**
* @inheritDoc
*/
- public function getTitle()
+ public function getTitle(): string
{
return $this->getLanguage()->get('wcf.user.notification.conversation.title');
}
/**
* @inheritDoc
*/
- public function getMessage()
+ public function getMessage(): string
{
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message', [
'author' => $this->author,
* @inheritDoc
* @since 5.2
*/
- public function getEmailTitle()
+ public function getEmailTitle(): string
{
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.mail.title', [
'author' => $this->author,
/**
* @inheritDoc
*/
- public function getLink()
+ public function getLink(): string
{
return $this->getUserNotificationObject()->getLink();
}
/**
* @inheritDoc
*/
- public function checkAccess()
+ public function checkAccess(): bool
{
return $this->getUserNotificationObject()->canRead();
}
/**
* @inheritDoc
*/
- public function getTitle()
+ public function getTitle(): string
{
return $this->getConversation()->subject;
}
/**
* @inheritDoc
*/
- public function getURL()
+ public function getURL(): string
{
return $this->getLink();
}
/**
* @inheritDoc
*/
- public function getTitle()
+ public function getTitle(): string
{
return $this->subject;
}
/**
* @inheritDoc
*/
- public function getURL()
+ public function getURL(): string
{
return $this->getLink();
}