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