MediaWiki
master
FormattedRCFeed.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\RCFeed
;
22
23
use
RecentChange
;
24
34
abstract
class
FormattedRCFeed
extends
RCFeed
{
35
private
$params;
36
40
public
function
__construct
( array $params ) {
41
$this->params =
$params
;
42
}
43
51
abstract
public
function
send
( array $feed, $line );
52
58
public
function
notify
(
RecentChange
$rc, $actionComment =
null
) {
59
$params = $this->params;
61
$formatter = is_object( $params[
'formatter'
] ) ? $params[
'formatter'
] :
new
$params[
'formatter'
];
62
63
$line = $formatter->getLine( $params, $rc, $actionComment );
64
if
( !$line ) {
65
// @codeCoverageIgnoreStart
66
// T109544 - If a feed formatter returns null, this will otherwise cause an
67
// error in at least RedisPubSubFeedEngine. Not sure best to handle this.
68
// @phan-suppress-next-line PhanTypeMismatchReturnProbablyReal
69
return
;
70
// @codeCoverageIgnoreEnd
71
}
72
return
$this->
send
( $params, $line );
73
}
74
}
76
class_alias( FormattedRCFeed::class,
'FormattedRCFeed'
);
$params
array $params
The job parameters.
Definition
UploadJobTrait.php:45
MediaWiki\RCFeed\FormattedRCFeed
Base class for RCFeed implementations that use RCFeedFormatter.
Definition
FormattedRCFeed.php:34
MediaWiki\RCFeed\FormattedRCFeed\__construct
__construct(array $params)
Definition
FormattedRCFeed.php:40
MediaWiki\RCFeed\FormattedRCFeed\notify
notify(RecentChange $rc, $actionComment=null)
Definition
FormattedRCFeed.php:58
MediaWiki\RCFeed\FormattedRCFeed\send
send(array $feed, $line)
Send some text to the specified feed.
MediaWiki\RCFeed\RCFeed
Definition
RCFeed.php:30
RecentChange
Utility class for creating new RC entries.
Definition
RecentChange.php:91
MediaWiki\RCFeed
Definition
FormattedRCFeed.php:21
includes
rcfeed
FormattedRCFeed.php
Generated on Fri Jul 26 2024 23:24:28 for MediaWiki by
1.10.0