Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
| MessagePage | |
100.00% |
7 / 7 |
|
100.00% |
6 / 6 |
6 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPreloadContent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getContentForTransclusion | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| existsForEdit | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDiffTitleMessage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getView | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\ShadowPage; |
| 4 | |
| 5 | use MediaWiki\Content\Content; |
| 6 | use MediaWiki\Page\PageReference; |
| 7 | use MediaWiki\Parser\ParserOptions; |
| 8 | use Wikimedia\Message\MessageSpecifier; |
| 9 | use Wikimedia\Message\MessageValue; |
| 10 | |
| 11 | /** |
| 12 | * Shadow page for nonexistent pages in the NS_MEDIAWIKI namespace |
| 13 | * @since 1.47 |
| 14 | */ |
| 15 | class MessagePage extends BaseShadowPage { |
| 16 | public function __construct( |
| 17 | private ParseHelper $parseHelper, |
| 18 | private Content $content, |
| 19 | private PageReference $title, |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function getPreloadContent(): ?Content { |
| 24 | return $this->content; |
| 25 | } |
| 26 | |
| 27 | public function getContentForTransclusion(): ?Content { |
| 28 | return $this->content; |
| 29 | } |
| 30 | |
| 31 | public function existsForEdit(): bool { |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | public function getDiffTitleMessage(): ?MessageSpecifier { |
| 36 | return new MessageValue( 'defaultmessagetext' ); |
| 37 | } |
| 38 | |
| 39 | public function getView( ParserOptions $parserOptions ): ?ShadowPageView { |
| 40 | return $this->parseHelper->getParsedContentView( |
| 41 | $this->content, $this->title, $parserOptions ); |
| 42 | } |
| 43 | |
| 44 | } |