This is a quick find & replace of calls to the deprecated method ParserOptions::newCanonical() when the context is the string literal 'canonical'. This can be safely replaced by called newFromAnon(). Change-Id: If7bb68459b11e0c5f5de188f10fdae85ad1a78bf
67 lines
1.1 KiB
PHP
67 lines
1.1 KiB
PHP
<?php
|
|
namespace MediaWiki\Content\Renderer;
|
|
|
|
use MediaWiki\Page\PageReference;
|
|
use ParserOptions;
|
|
|
|
/**
|
|
* @internal
|
|
* An object to hold parser params.
|
|
*/
|
|
class ContentParseParams {
|
|
/** @var PageReference */
|
|
private $page;
|
|
|
|
/** @var int|null */
|
|
private $revId;
|
|
|
|
/** @var ParserOptions */
|
|
private $parserOptions;
|
|
|
|
/** @var bool */
|
|
private $generateHtml;
|
|
|
|
public function __construct(
|
|
PageReference $page,
|
|
int $revId = null,
|
|
ParserOptions $parserOptions = null,
|
|
bool $generateHtml = true
|
|
) {
|
|
$this->page = $page;
|
|
$this->parserOptions = $parserOptions ?? ParserOptions::newFromAnon();
|
|
$this->revId = $revId;
|
|
$this->generateHtml = $generateHtml;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return PageReference
|
|
*/
|
|
public function getPage(): PageReference {
|
|
return $this->page;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return int|null
|
|
*/
|
|
public function getRevId(): ?int {
|
|
return $this->revId;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return ParserOptions
|
|
*/
|
|
public function getParserOptions(): ParserOptions {
|
|
return $this->parserOptions;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function getGenerateHtml(): bool {
|
|
return $this->generateHtml;
|
|
}
|
|
}
|