Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
EchoWelcomePresentationModel | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
20 | |
0.00% |
0 / 1 |
getIconType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getPrimaryLink | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\Notifications\Formatters; |
4 | |
5 | use MediaWiki\Title\Title; |
6 | |
7 | class EchoWelcomePresentationModel extends EchoEventPresentationModel { |
8 | |
9 | public function getIconType() { |
10 | return 'site'; |
11 | } |
12 | |
13 | public function getPrimaryLink() { |
14 | $msg = $this->msg( 'notification-welcome-link' ); |
15 | if ( $msg->isDisabled() ) { |
16 | return false; |
17 | } |
18 | |
19 | $title = Title::newFromText( $msg->plain() ); |
20 | if ( !$title ) { |
21 | return false; |
22 | } |
23 | |
24 | return [ |
25 | 'url' => $title->getFullURL(), |
26 | 'label' => $this->msg( 'notification-welcome-linktext' )->text(), |
27 | ]; |
28 | } |
29 | } |