Debian Codegraph @

includes/OutputTransform/ContentTextTransformStage.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\OutputTransform;
4
5 use MediaWiki\Parser\ParserOptions;
6 use MediaWiki\Parser\ParserOutput;
7
8 /**
9 * OutputTransformStages that only modify the content. It is expected that all inheriting classes call this class'
10 * transform() method (either directly by inheritance or by calling them in the overloaded method).
11 * @internal
12 */
13 abstract class ContentTextTransformStage extends OutputTransformStage {
14
15 public function transform( ParserOutput $po, ?ParserOptions $popts, array &$options ): ParserOutput {
16 $text = $po->getContentHolderText();
17 $text = $this->transformText( $text, $po, $popts, $options );
18 $po->setContentHolderText( $text );
19 return $po;
20 }
21
22 abstract protected function transformText(
23 string $text, ParserOutput $po, ?ParserOptions $popts, array &$options
24 ): string;
25 }