Stricted typing + protected on FilteringNoticeStream->filter
This commit is contained in:
parent
79d68a52d0
commit
b4271a3533
@ -49,12 +49,12 @@ abstract class FilteringNoticeStream extends NoticeStream
|
|||||||
{
|
{
|
||||||
protected $upstream;
|
protected $upstream;
|
||||||
|
|
||||||
function __construct($upstream)
|
function __construct(NoticeStream $upstream)
|
||||||
{
|
{
|
||||||
$this->upstream = $upstream;
|
$this->upstream = $upstream;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract function filter($notice);
|
abstract protected function filter(Notice $notice);
|
||||||
|
|
||||||
function getNoticeIds($offset, $limit, $since_id, $max_id)
|
function getNoticeIds($offset, $limit, $since_id, $max_id)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,7 @@ class ScopingNoticeStream extends FilteringNoticeStream
|
|||||||
* @return boolean whether to include the notice
|
* @return boolean whether to include the notice
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function filter($notice)
|
protected function filter(Notice $notice)
|
||||||
{
|
{
|
||||||
return $notice->inScope($this->scoped);
|
return $notice->inScope($this->scoped);
|
||||||
}
|
}
|
||||||
|
@ -28,11 +28,7 @@
|
|||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET')) {
|
if (!defined('GNUSOCIAL')) { exit(1); }
|
||||||
// This check helps protect against security problems;
|
|
||||||
// your code file can't be executed directly from the web.
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This notice stream filters notices by whether their conversation
|
* This notice stream filters notices by whether their conversation
|
||||||
@ -58,7 +54,7 @@ class ThreadingNoticeStream extends FilteringNoticeStream
|
|||||||
return parent::getNotices($offset, $limit, $sinceId, $maxId);
|
return parent::getNotices($offset, $limit, $sinceId, $maxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function filter($notice)
|
protected function filter(Notice $notice)
|
||||||
{
|
{
|
||||||
if (!array_key_exists($notice->conversation, $this->seen)) {
|
if (!array_key_exists($notice->conversation, $this->seen)) {
|
||||||
$this->seen[$notice->conversation] = true;
|
$this->seen[$notice->conversation] = true;
|
||||||
|
@ -64,7 +64,7 @@ class EventsNoticeStream extends ScopingNoticeStream
|
|||||||
parent::__construct(new CachingNoticeStream($stream, $key), $scoped);
|
parent::__construct(new CachingNoticeStream($stream, $key), $scoped);
|
||||||
}
|
}
|
||||||
|
|
||||||
function filter($notice)
|
protected function filter(Notice $notice)
|
||||||
{
|
{
|
||||||
if (!parent::filter($notice)) {
|
if (!parent::filter($notice)) {
|
||||||
// if not in our scope, return false
|
// if not in our scope, return false
|
||||||
|
Loading…
Reference in New Issue
Block a user