2 namespace MediaWiki\Content\Renderer
;
4 use MediaWiki\Page\PageReference
;
5 use MediaWiki\Parser\ParserOptions
;
6 use MediaWiki\Parser\ParserOutput
;
10 * An object to hold parser params.
12 class ContentParseParams
{
13 /** @var PageReference */
19 /** @var ParserOptions */
20 private $parserOptions;
23 private $generateHtml;
25 /** @var ?ParserOutput */
26 private $previousOutput;
28 public function __construct(
31 ?ParserOptions
$parserOptions = null,
32 bool $generateHtml = true,
33 ?ParserOutput
$previousOutput = null
36 $this->parserOptions
= $parserOptions ?? ParserOptions
::newFromAnon();
37 $this->revId
= $revId;
38 $this->generateHtml
= $generateHtml;
39 $this->previousOutput
= $previousOutput;
44 * @return PageReference
46 public function getPage(): PageReference
{
54 public function getRevId(): ?
int {
60 * @return ParserOptions
62 public function getParserOptions(): ParserOptions
{
63 return $this->parserOptions
;
70 public function getGenerateHtml(): bool {
71 return $this->generateHtml
;
76 * @return ?ParserOutput
78 public function getPreviousOutput(): ?ParserOutput
{
79 return $this->previousOutput
;