From: Roland Haeder Date: Mon, 25 Jan 2016 17:02:01 +0000 (+0100) Subject: Cannot use NoticeListemItem as type-hint as NoticeListItemAdapter exists. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a44920024a8c7958072ef91653f94f80c5206311;p=quix0rs-gnu-social.git Cannot use NoticeListemItem as type-hint as NoticeListItemAdapter exists. Signed-off-by: Roland Haeder --- diff --git a/lib/noticelistitemadapter.php b/lib/noticelistitemadapter.php index a80b63088c..9c9442db90 100644 --- a/lib/noticelistitemadapter.php +++ b/lib/noticelistitemadapter.php @@ -53,7 +53,7 @@ class NoticeListItemAdapter * * @param NoticeListItem $nli item to wrap */ - function __construct($nli) + function __construct(NoticeListItem $nli) { $this->nli = $nli; } diff --git a/plugins/ActivitySpam/ActivitySpamPlugin.php b/plugins/ActivitySpam/ActivitySpamPlugin.php index e4cdc40d3e..866f4e9ee2 100644 --- a/plugins/ActivitySpam/ActivitySpamPlugin.php +++ b/plugins/ActivitySpam/ActivitySpamPlugin.php @@ -144,8 +144,11 @@ class ActivitySpamPlugin extends Plugin return false; } - function onEndShowNoticeOptionItems(NoticeListItem $nli) + function onEndShowNoticeOptionItems($nli) { + // FIXME: Cannot use type-hint NoticeListItem as NoticeListItemAdapter exists, too! + assert(is_object($nli)); + $profile = Profile::current(); if (!empty($profile) && $profile->hasRight(self::TRAINSPAM)) { diff --git a/plugins/Share/SharePlugin.php b/plugins/Share/SharePlugin.php index 84ba42a7b9..d421bca602 100644 --- a/plugins/Share/SharePlugin.php +++ b/plugins/Share/SharePlugin.php @@ -228,8 +228,11 @@ class SharePlugin extends ActivityVerbHandlerPlugin * * @return void */ - public function onEndShowNoticeOptionItems(NoticeListItem $nli) + public function onEndShowNoticeOptionItems($nli) { + // FIXME: Cannot use type-hint NoticeListItem as NoticeListItemAdapter exists, too! + assert(is_object($nli)); + // FIXME: Use bitmasks (but be aware that PUBLIC_SCOPE is 0!) // Also: AHHH, $scope and $scoped are scarily similar looking. $scope = $nli->notice->getScope();