From 7d532889928be0c324f2adf16db5e1d4b72f25e5 Mon Sep 17 00:00:00 2001 From: lens0021 Date: Sun, 10 Jul 2022 17:41:57 +0900 Subject: [PATCH] doc: cleanup --- includes/HookHandlers/Main.php | 4 ++-- includes/HookHandlers/RelatedArticles.php | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/includes/HookHandlers/Main.php b/includes/HookHandlers/Main.php index 547d8bd..3552ccf 100644 --- a/includes/HookHandlers/Main.php +++ b/includes/HookHandlers/Main.php @@ -89,7 +89,7 @@ public function onSidebarBeforeOutput( $skin, &$sidebar ): void { * - Wikibase\Client\RepoItemLinkGenerator::getNewItemUrl (REL1_35) * * @param Skin $skin - * @param array &$sidebar + * @param array $sidebar * @return void */ private function addWikibaseNewItemLink( $skin, &$sidebar ): void { @@ -116,7 +116,7 @@ private function addWikibaseNewItemLink( $skin, &$sidebar ): void { /** * Treat external links to FemiWiki as internal links in the Sidebar. - * @param array &$bar + * @param array $bar * @return void */ private function sidebarConvertLinks( &$bar ): void { diff --git a/includes/HookHandlers/RelatedArticles.php b/includes/HookHandlers/RelatedArticles.php index a19e3e7..ff497a6 100644 --- a/includes/HookHandlers/RelatedArticles.php +++ b/includes/HookHandlers/RelatedArticles.php @@ -5,8 +5,8 @@ use Config; use ExtensionRegistry; use MediaWiki\MediaWikiServices; -use Title; use MediaWiki\Page\PageStoreRecord; +use Title; use Wikimedia\Rdbms\DBConnRef; use Wikimedia\Rdbms\ILoadBalancer; use Wikimedia\Rdbms\SelectQueryBuilder; @@ -139,7 +139,7 @@ private function makeTitlesFromHereSQL( Title $title, DBConnRef $dbr, $targetNam // Hide redirects 'rd_from' => null, ] ) - ->fields( self::getSelectFields() ) + ->fields( self::getSelectFields() ) ->getSQL(); } @@ -173,7 +173,7 @@ private function makeRedirectedTitlesFromHereSQL( Title $title, DBConnRef $dbr, // Only redirects 'rd_from != 0', ] ) - ->fields( self::getSelectFields( 'target' ) ) + ->fields( self::getSelectFields( 'target' ) ) ->getSQL(); } @@ -203,7 +203,7 @@ private function makeTitlesToHereSQL( Title $title, DBConnRef $dbr, $targetNames ->conds( $targetNamespaces ? [ 'page_namespace' => $targetNamespaces, ] : [] ) - ->fields( self::getSelectFields() ) + ->fields( self::getSelectFields() ) ->getSQL(); } @@ -245,6 +245,10 @@ private function makeTitlesToRedirectsOfHereSQL( Title $title, DBConnRef $dbr, $ ->getSQL(); } + /** + * @param string|null $table + * @return array + */ public static function getSelectFields( $table = null ) { $pageLanguageUseDB = MediaWikiServices::getInstance()->getMainConfig()->get( 'PageLanguageUseDB' ); @@ -262,7 +266,7 @@ public static function getSelectFields( $table = null ) { } if ( $table ) { - foreach( $fields as $f ) { + foreach ( $fields as $f ) { $fieldMap[$f] = "$table.$f"; } return $fieldMap;