| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\OutputTransform; |
| 4 |
|
| 5 |
use MediaWiki\Parser\ParserOptions; |
| 6 |
use MediaWiki\Parser\ParserOutput; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 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 |
} |