It can be difficult to distinguish between ParserOutput and OutputPage values, since both are often named $out or $output. Use more distinctive variable names to make it easier to read the code (and use code search) for uses of the OutputPageParserOutput hook, where both types are present in close proximity. See T293860 for an instance of this confusion biting us in production, and I386e99df01f889a80de26e861142bdb606aa649d for a related tidying-up in Wikibase. Change-Id: I0ccb7484eb3b2e2ae6a5a85c3e08d7d48b1e6146
26 lines
679 B
PHP
26 lines
679 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Hook;
|
|
|
|
use OutputPage;
|
|
use ParserOutput;
|
|
|
|
/**
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
* Use the hook name "OutputPageParserOutput" to register handlers implementing this interface.
|
|
*
|
|
* @stable to implement
|
|
* @ingroup Hooks
|
|
*/
|
|
interface OutputPageParserOutputHook {
|
|
/**
|
|
* This hook is called after adding a parserOutput to $wgOut.
|
|
*
|
|
* @since 1.35
|
|
*
|
|
* @param OutputPage $outputPage
|
|
* @param ParserOutput $parserOutput ParserOutput instance being added in $outputPage
|
|
* @return void This hook must not abort, it must return no value
|
|
*/
|
|
public function onOutputPageParserOutput( $outputPage, $parserOutput ): void;
|
|
}
|