Rename variables to disambiguate OutputPageParserOutput hook

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
This commit is contained in:
C. Scott Ananian 2021-11-23 15:50:01 -05:00
parent 59d728f136
commit 4a04259070
2 changed files with 5 additions and 5 deletions

View file

@ -18,9 +18,9 @@ interface OutputPageParserOutputHook {
*
* @since 1.35
*
* @param OutputPage $out
* @param ParserOutput $parserOutput ParserOutput instance being added in $out
* @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( $out, $parserOutput ): void;
public function onOutputPageParserOutput( $outputPage, $parserOutput ): void;
}

View file

@ -2669,10 +2669,10 @@ class HookRunner implements
);
}
public function onOutputPageParserOutput( $out, $parserOutput ): void {
public function onOutputPageParserOutput( $outputPage, $parserOutput ): void {
$this->container->run(
'OutputPageParserOutput',
[ $out, $parserOutput ],
[ $outputPage, $parserOutput ],
[ 'abortable' => false ]
);
}