]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Stricted typing + protected on FilteringNoticeStream->filter
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 2 Mar 2016 10:40:43 +0000 (11:40 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 2 Mar 2016 10:40:43 +0000 (11:40 +0100)
lib/filteringnoticestream.php
lib/scopingnoticestream.php
lib/threadingnoticestream.php
plugins/Event/lib/eventsnoticestream.php

index b4ec6687bb7c92831ed30114d0de9847cfdbab45..979305ad39f57cf176e6876df236fe2eb0270689 100644 (file)
@@ -49,12 +49,12 @@ abstract class FilteringNoticeStream extends NoticeStream
 {
     protected $upstream;
 
-    function __construct($upstream)
+    function __construct(NoticeStream $upstream)
     {
         $this->upstream = $upstream;
     }
 
-    abstract function filter($notice);
+    abstract protected function filter(Notice $notice);
 
     function getNoticeIds($offset, $limit, $since_id, $max_id)
     {
index 84af75948df626488191fb8757c15d9a0dc8c42a..854903d33dee0414e5bab488052705afa08caa27 100644 (file)
@@ -61,7 +61,7 @@ class ScopingNoticeStream extends FilteringNoticeStream
      * @return boolean whether to include the notice
      */
 
-    function filter($notice)
+    protected function filter(Notice $notice)
     {
         return $notice->inScope($this->scoped);
     }
index 167a9584a6d7641e7c3ecb2d30245a1f282b8e14..de113b2a41a096adf972fa7cb73b5abb58fb4877 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    // This check helps protect against security problems;
-    // your code file can't be executed directly from the web.
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * This notice stream filters notices by whether their conversation
@@ -58,7 +54,7 @@ class ThreadingNoticeStream extends FilteringNoticeStream
         return parent::getNotices($offset, $limit, $sinceId, $maxId);
     }
 
-    function filter($notice)
+    protected function filter(Notice $notice)
     {
         if (!array_key_exists($notice->conversation, $this->seen)) {
             $this->seen[$notice->conversation] = true;
index 3dd1a81bd1243b7be1fd37050255239479e9efb3..b9e40430e700c8337794eb7bee8010cf002937a1 100644 (file)
@@ -64,7 +64,7 @@ class EventsNoticeStream extends ScopingNoticeStream
         parent::__construct(new CachingNoticeStream($stream, $key), $scoped);
     }
 
-    function filter($notice)
+    protected function filter(Notice $notice)
     {
         if (!parent::filter($notice)) {
             // if not in our scope, return false