Skip to content

Commit

Permalink
doc: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Jul 10, 2022
1 parent 104d206 commit 7d53288
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions includes/HookHandlers/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
14 changes: 9 additions & 5 deletions includes/HookHandlers/RelatedArticles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -139,7 +139,7 @@ private function makeTitlesFromHereSQL( Title $title, DBConnRef $dbr, $targetNam
// Hide redirects
'rd_from' => null,
] )
->fields( self::getSelectFields() )
->fields( self::getSelectFields() )
->getSQL();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -203,7 +203,7 @@ private function makeTitlesToHereSQL( Title $title, DBConnRef $dbr, $targetNames
->conds( $targetNamespaces ? [
'page_namespace' => $targetNamespaces,
] : [] )
->fields( self::getSelectFields() )
->fields( self::getSelectFields() )
->getSQL();
}

Expand Down Expand Up @@ -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' );

Expand All @@ -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;
Expand Down

0 comments on commit 7d53288

Please sign in to comment.