Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
HookRunner | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
onMassMessageJobBeforeMessageSent | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace MediaWiki\MassMessage\Job\Hooks; |
4 | |
5 | use MediaWiki\HookContainer\HookContainer; |
6 | use MediaWiki\MassMessage\LanguageAwareText; |
7 | use MediaWiki\Title\Title; |
8 | |
9 | class HookRunner implements MassMessageJobBeforeMessageSentHook { |
10 | |
11 | /** @var HookContainer */ |
12 | private $hookContainer; |
13 | |
14 | /** |
15 | * @param HookContainer $hookContainer |
16 | */ |
17 | public function __construct( HookContainer $hookContainer ) { |
18 | $this->hookContainer = $hookContainer; |
19 | } |
20 | |
21 | /** |
22 | * @inheritDoc |
23 | */ |
24 | public function onMassMessageJobBeforeMessageSent( |
25 | callable $failureCallback, |
26 | Title $targetPage, |
27 | string $subject, |
28 | string $message, |
29 | ?LanguageAwareText $pageSubject, |
30 | ?LanguageAwareText $pageMessage, |
31 | array $comment |
32 | ) { |
33 | return $this->hookContainer->run( |
34 | 'MassMessageJobBeforeMessageSent', |
35 | [ $failureCallback, $targetPage, $subject, $message, $pageSubject, $pageMessage, $comment ] |
36 | ); |
37 | } |
38 | } |