Update ContentTransformer to access ContentHandler::preLoadTransform through the service. Prepare object to hold a data that required for ContentHandler::preLoadTranform params. This is a fully backwards compatible change. We are doing hard deprecation via MWDebug::detectDeprecatedOverride. However, with the ContentHandler calling Content and Content calling ContentHandler, it doesn't matter whether callers use Content or ContentHandler. This will allow us to naturally convert all callers. Bug: T287157 Change-Id: I89537e1e7d24c6e15252b2b51890a0bd81ea3e6b
50 lines
909 B
PHP
50 lines
909 B
PHP
<?php
|
|
namespace MediaWiki\Content\Transform;
|
|
|
|
use MediaWiki\Page\PageReference;
|
|
use ParserOptions;
|
|
|
|
/**
|
|
* @internal
|
|
* An object to hold preload transform params.
|
|
*/
|
|
class PreloadTransformParamsValue implements PreloadTransformParams {
|
|
/** @var PageReference */
|
|
private $page;
|
|
|
|
/** @var array */
|
|
private $params;
|
|
|
|
/** @var ParserOptions */
|
|
private $parserOptions;
|
|
|
|
public function __construct( PageReference $page, ParserOptions $parserOptions, array $params = [] ) {
|
|
$this->page = $page;
|
|
$this->parserOptions = $parserOptions;
|
|
$this->params = $params;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return PageReference
|
|
*/
|
|
public function getPage(): PageReference {
|
|
return $this->page;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getParams(): array {
|
|
return $this->params;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return ParserOptions
|
|
*/
|
|
public function getParserOptions(): ParserOptions {
|
|
return $this->parserOptions;
|
|
}
|
|
}
|