Skip to content

Commit

Permalink
Add explicit return types to IUserNotificationEvent::getTitle() and :…
Browse files Browse the repository at this point in the history
…:getLink()

These are required since #5157, because the actual event classes implement both
this interface and the ITitledObject/ILinkableObject interfaces, requiring both
interfaces to be compatible.

This breaks the `null` return value for `getLink()`, but implementing classes
can just implement the compatibility link to NotificationListPage themselves.
  • Loading branch information
TimWolla committed Feb 2, 2023
1 parent da35f16 commit 123f222
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ interface IUserNotificationEvent extends IDatabaseObjectProcessor
{
/**
* Returns a short title used for the notification overlay, e.g. "New follower".
*
* @return string
*/
public function getTitle();
public function getTitle(): string;

/**
* Returns the notification event message, e.g. "dtdesign is now following you".
Expand All @@ -36,15 +34,8 @@ public function getMessage();

/**
* Returns object link.
*
* The returned value can be `null` however, this should be avoided as much as possible.
* If the returned value is `null`, the NotificationListPage will be used a link, on any
* place, where the link is required (e.g. in the NotificationConfirmAction). After the
* confirmation of the notification, the notification is not clickable anymore.
*
* @return ?string
*/
public function getLink();
public function getLink(): string;

/**
* Returns the full title for this notification, e.g. for use with e-mails.
Expand Down

0 comments on commit 123f222

Please sign in to comment.