Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
ContentParseParams | |
0.00% |
0 / 10 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
getPage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getRevId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getParserOptions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getGenerateHtml | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getPreviousOutput | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | namespace MediaWiki\Content\Renderer; |
3 | |
4 | use MediaWiki\Page\PageReference; |
5 | use MediaWiki\Parser\ParserOptions; |
6 | use MediaWiki\Parser\ParserOutput; |
7 | |
8 | /** |
9 | * @internal |
10 | * An object to hold parser params. |
11 | */ |
12 | class ContentParseParams { |
13 | /** @var PageReference */ |
14 | private $page; |
15 | |
16 | /** @var int|null */ |
17 | private $revId; |
18 | |
19 | /** @var ParserOptions */ |
20 | private $parserOptions; |
21 | |
22 | /** @var bool */ |
23 | private $generateHtml; |
24 | |
25 | /** @var ?ParserOutput */ |
26 | private $previousOutput; |
27 | |
28 | public function __construct( |
29 | PageReference $page, |
30 | ?int $revId = null, |
31 | ?ParserOptions $parserOptions = null, |
32 | bool $generateHtml = true, |
33 | ?ParserOutput $previousOutput = null |
34 | ) { |
35 | $this->page = $page; |
36 | $this->parserOptions = $parserOptions ?? ParserOptions::newFromAnon(); |
37 | $this->revId = $revId; |
38 | $this->generateHtml = $generateHtml; |
39 | $this->previousOutput = $previousOutput; |
40 | } |
41 | |
42 | public function getPage(): PageReference { |
43 | return $this->page; |
44 | } |
45 | |
46 | public function getRevId(): ?int { |
47 | return $this->revId; |
48 | } |
49 | |
50 | public function getParserOptions(): ParserOptions { |
51 | return $this->parserOptions; |
52 | } |
53 | |
54 | public function getGenerateHtml(): bool { |
55 | return $this->generateHtml; |
56 | } |
57 | |
58 | public function getPreviousOutput(): ?ParserOutput { |
59 | return $this->previousOutput; |
60 | } |
61 | } |