MediaWiki
master
FormattedRCFeed.php
Go to the documentation of this file.
1
<?php
7
namespace
MediaWiki\RCFeed
;
8
9
use
MediaWiki\RecentChanges\RecentChange
;
10
21
abstract
class
FormattedRCFeed
extends
RCFeed
{
22
private
array $params;
23
24
public
function
__construct
( array $params ) {
25
$this->params = $params;
26
}
27
35
abstract
public
function
send
( array $feed, $line );
36
42
public
function
notify
(
RecentChange
$rc, $actionComment =
null
) {
43
$params = $this->params;
45
$formatter = is_object( $params[
'formatter'
] ) ? $params[
'formatter'
] :
new
$params[
'formatter'
];
46
47
$line = $formatter->getLine( $params, $rc, $actionComment );
48
if
( !$line ) {
49
// @codeCoverageIgnoreStart
50
// T109544 - If a feed formatter returns null, this will otherwise cause an
51
// error in at least RedisPubSubFeedEngine. Not sure best to handle this.
52
// @phan-suppress-next-line PhanTypeMismatchReturnProbablyReal
53
return
;
54
// @codeCoverageIgnoreEnd
55
}
56
return
$this->
send
( $params, $line );
57
}
58
}
60
class_alias( FormattedRCFeed::class,
'FormattedRCFeed'
);
MediaWiki\RCFeed\FormattedRCFeed
Base class for RCFeed implementations that use RCFeedFormatter.
Definition
FormattedRCFeed.php:21
MediaWiki\RCFeed\FormattedRCFeed\__construct
__construct(array $params)
Definition
FormattedRCFeed.php:24
MediaWiki\RCFeed\FormattedRCFeed\notify
notify(RecentChange $rc, $actionComment=null)
Definition
FormattedRCFeed.php:42
MediaWiki\RCFeed\FormattedRCFeed\send
send(array $feed, $line)
Send some text to the specified feed.
MediaWiki\RCFeed\RCFeed
Definition
RCFeed.php:17
MediaWiki\RecentChanges\RecentChange
Utility class for creating and reading rows in the recentchanges table.
Definition
RecentChange.php:91
MediaWiki\RCFeed
Definition
FormattedRCFeed.php:7
includes
RCFeed
FormattedRCFeed.php
Generated on Sun Nov 9 2025 13:26:13 for MediaWiki by
1.10.0