Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\MassMessage\Job\Hooks; |
4 | |
5 | use MediaWiki\MassMessage\LanguageAwareText; |
6 | use MediaWiki\Title\Title; |
7 | |
8 | interface MassMessageJobBeforeMessageSentHook { |
9 | /** |
10 | * Hook runner for `MassMessageJobBeforeMessageSent` hook |
11 | * |
12 | * Allows overriding how mass messages are sent. For example, |
13 | * if you had a custom discussion page extension, you might want |
14 | * to use this to change how messages are posted on user talk pages. |
15 | * |
16 | * Generally you would use the MessageBuilder class to actually |
17 | * construct the text of the message. |
18 | * |
19 | * Returning false will prevent MassMessage from sending the message. If |
20 | * your hook sent the message itself, you should return false to prevent |
21 | * MassMessage from trying to send the same message again. |
22 | * |
23 | * @param callable $failureCallback proxy for MassMessageJob::logLocalFailure |
24 | * @param Title $targetPage Page message is being sent to |
25 | * @param string $subject |
26 | * @param string $message |
27 | * @param ?LanguageAwareText $pageSubject |
28 | * @param ?LanguageAwareText $pageMessage |
29 | * @param string[] $comment Parameters to 'massmessage-hidden-comment' message |
30 | * @return bool|void True to have MassMessage send the message normally, false to not |
31 | */ |
32 | public function onMassMessageJobBeforeMessageSent( |
33 | callable $failureCallback, |
34 | Title $targetPage, |
35 | string $subject, |
36 | string $message, |
37 | ?LanguageAwareText $pageSubject, |
38 | ?LanguageAwareText $pageMessage, |
39 | array $comment |
40 | ); |
41 | } |