MediaWiki
master
FormattedRCFeed.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\RCFeed
;
22
23
use
MediaWiki\RecentChanges\RecentChange
;
24
35
abstract
class
FormattedRCFeed
extends
RCFeed
{
36
private
array $params;
37
38
public
function
__construct
( array $params ) {
39
$this->params = $params;
40
}
41
49
abstract
public
function
send
( array $feed, $line );
50
56
public
function
notify
(
RecentChange
$rc, $actionComment =
null
) {
57
$params = $this->params;
59
$formatter = is_object( $params[
'formatter'
] ) ? $params[
'formatter'
] :
new
$params[
'formatter'
];
60
61
$line = $formatter->getLine( $params, $rc, $actionComment );
62
if
( !$line ) {
63
// @codeCoverageIgnoreStart
64
// T109544 - If a feed formatter returns null, this will otherwise cause an
65
// error in at least RedisPubSubFeedEngine. Not sure best to handle this.
66
// @phan-suppress-next-line PhanTypeMismatchReturnProbablyReal
67
return
;
68
// @codeCoverageIgnoreEnd
69
}
70
return
$this->
send
( $params, $line );
71
}
72
}
74
class_alias( FormattedRCFeed::class,
'FormattedRCFeed'
);
MediaWiki\RCFeed\FormattedRCFeed
Base class for RCFeed implementations that use RCFeedFormatter.
Definition
FormattedRCFeed.php:35
MediaWiki\RCFeed\FormattedRCFeed\__construct
__construct(array $params)
Definition
FormattedRCFeed.php:38
MediaWiki\RCFeed\FormattedRCFeed\notify
notify(RecentChange $rc, $actionComment=null)
Definition
FormattedRCFeed.php:56
MediaWiki\RCFeed\FormattedRCFeed\send
send(array $feed, $line)
Send some text to the specified feed.
MediaWiki\RCFeed\RCFeed
Definition
RCFeed.php:31
MediaWiki\RecentChanges\RecentChange
Utility class for creating and reading rows in the recentchanges table.
Definition
RecentChange.php:116
MediaWiki\RCFeed
Definition
FormattedRCFeed.php:21
includes
recentchanges
RCFeed
FormattedRCFeed.php
Generated on Fri Mar 28 2025 16:25:30 for MediaWiki by
1.10.0