mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-24 00:05:50 +00:00
Stop passing objects by reference
Bug: T193950 Change-Id: I36dc8a0f887bf11275f9cf3611651ca1091cd9f7
This commit is contained in:
parent
ae1862edba
commit
bc24e8a71d
|
@ -6,6 +6,7 @@ use Parser;
|
||||||
use OutputPage;
|
use OutputPage;
|
||||||
use ParserOutput;
|
use ParserOutput;
|
||||||
use MediaWiki\MediaWikiServices;
|
use MediaWiki\MediaWikiServices;
|
||||||
|
use ResourceLoader;
|
||||||
use Skin;
|
use Skin;
|
||||||
use User;
|
use User;
|
||||||
use DisambiguatorHooks;
|
use DisambiguatorHooks;
|
||||||
|
@ -144,10 +145,10 @@ class Hooks {
|
||||||
* Registers the <code>related</code> parser function (see
|
* Registers the <code>related</code> parser function (see
|
||||||
* {@see Hooks::onFuncRelated}).
|
* {@see Hooks::onFuncRelated}).
|
||||||
*
|
*
|
||||||
* @param Parser &$parser Parser object
|
* @param Parser $parser Parser object
|
||||||
* @return bool Always <code>true</code>
|
* @return bool Always <code>true</code>
|
||||||
*/
|
*/
|
||||||
public static function onParserFirstCallInit( Parser &$parser ) {
|
public static function onParserFirstCallInit( Parser $parser ) {
|
||||||
$parser->setFunctionHook( 'related', 'RelatedArticles\\Hooks::onFuncRelated' );
|
$parser->setFunctionHook( 'related', 'RelatedArticles\\Hooks::onFuncRelated' );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -191,11 +192,11 @@ class Hooks {
|
||||||
* The list of related pages will be retrieved using
|
* The list of related pages will be retrieved using
|
||||||
* <code>ParserOutput#getExtensionData</code>.
|
* <code>ParserOutput#getExtensionData</code>.
|
||||||
*
|
*
|
||||||
* @param OutputPage &$out the OutputPage object
|
* @param OutputPage $out the OutputPage object
|
||||||
* @param ParserOutput $parserOutput ParserOutput object
|
* @param ParserOutput $parserOutput ParserOutput object
|
||||||
* @return bool Always <code>true</code>
|
* @return bool Always <code>true</code>
|
||||||
*/
|
*/
|
||||||
public static function onOutputPageParserOutput( OutputPage &$out, ParserOutput $parserOutput ) {
|
public static function onOutputPageParserOutput( OutputPage $out, ParserOutput $parserOutput ) {
|
||||||
$related = $parserOutput->getExtensionData( 'RelatedArticles' );
|
$related = $parserOutput->getExtensionData( 'RelatedArticles' );
|
||||||
|
|
||||||
if ( $related ) {
|
if ( $related ) {
|
||||||
|
@ -210,10 +211,10 @@ class Hooks {
|
||||||
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
|
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
|
||||||
*
|
*
|
||||||
* @param array &$modules array of javascript testing modules
|
* @param array &$modules array of javascript testing modules
|
||||||
* @param \ResourceLoader &$rl Resource Loader
|
* @param ResourceLoader $rl Resource Loader
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function onResourceLoaderTestModules( &$modules, &$rl ) {
|
public static function onResourceLoaderTestModules( &$modules, ResourceLoader $rl ) {
|
||||||
$boilerplate = [
|
$boilerplate = [
|
||||||
'localBasePath' => __DIR__ . '/../tests/qunit/',
|
'localBasePath' => __DIR__ . '/../tests/qunit/',
|
||||||
'remoteExtPath' => 'RelatedArticles/tests/qunit',
|
'remoteExtPath' => 'RelatedArticles/tests/qunit',
|
||||||
|
|
Loading…
Reference in a new issue