]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
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 Häder <roland@mxchange.org>
Sun, 29 Mar 2020 22:21:38 +0000 (00:21 +0200)
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 e4cdc40d3e22c2eb1e1c40d3e0b338ac1f2bcbaf..866f4e9ee2076cd935e537aef97112e1bc8ca506 100644 (file)
@@ -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)) {
index 84ba42a7b99cab6d8effec3507128078b31875f1..d421bca602d29a7667dc702ca0932b7bfd728b29 100644 (file)
@@ -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();