Cannot use NoticeListemItem as type-hint as NoticeListItemAdapter exists.
authorRoland Haeder <roland@mxchange.org>
Mon, 25 Jan 2016 17:02:01 +0000 (18:02 +0100)
committerRoland Haeder <roland@mxchange.org>
Mon, 25 Jan 2016 17:02:01 +0000 (18:02 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/noticelistitemadapter.php
plugins/ActivitySpam/ActivitySpamPlugin.php
plugins/Share/SharePlugin.php

index a80b63088ce61488fe124afb39ffe9af55df34bc..9c9442db902178fa61f2219adbcb2a042ce373c1 100644 (file)
@@ -53,7 +53,7 @@ class NoticeListItemAdapter
      *
      * @param NoticeListItem $nli item to wrap
      */
-    function __construct($nli)
+    function __construct(NoticeListItem $nli)
     {
         $this->nli = $nli;
     }
index 4e18cc31aa26e145053416678780580676e628d9..ca31c7ac8e7ea596a7d39fd6c1c3f5db39b704f8 100644 (file)
@@ -142,8 +142,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)) {
index 492898090684abb4665de6952627163182b7206a..a1d5f03b2c746e10bc848d2f0975b36e5bc199a5 100644 (file)
@@ -227,8 +227,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();