Skip to content

Commit

Permalink
Some cleanup (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 7, 2025
1 parent 2126db3 commit c30cb8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static function executeTag( $input, array $args, Parser $parser, PPFrame
if ( $reset['categories'] ?? false ) {
$saveCategories = array_combine(
$parserOutput->getCategoryNames(),
array_map( fn ( $value ) => $parserOutput->getCategorySortKey( $value ), $parserOutput->getCategoryNames() )
array_map( static fn ( $value ) => $parserOutput->getCategorySortKey( $value ), $parserOutput->getCategoryNames() )
);
}

Expand Down Expand Up @@ -629,7 +629,7 @@ public static function endEliminate( $parser, &$text ) {
$categories = array_combine(
$parserOutput->getCategoryNames(),
array_map(
fn ( $value ) => $parserOutput->getCategorySortKey( $value ) ?? '',
static fn ( $value ) => $parserOutput->getCategorySortKey( $value ) ?? '',
$parserOutput->getCategoryNames()
)
);
Expand Down
4 changes: 2 additions & 2 deletions includes/Parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ public function parse( $input, Parser $parser, &$reset, &$eliminate, $isParserTa
$calcRows = true;
}

/*********/
/***/
/* Query */
/*********/
/***/
try {
$query = new Query( $this->parameters );

Expand Down
8 changes: 3 additions & 5 deletions maintenance/CreateTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

use MediaWiki\CommentStore\CommentStoreComment;
use MediaWiki\Maintenance\LoggedUpdateMaintenance;
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Title\Title;
use MediaWiki\User\User;

class CreateTemplate extends LoggedUpdateMaintenance {
Expand Down Expand Up @@ -45,12 +43,12 @@ protected function updateSkippedMessage(): string {
* @return bool
*/
protected function doDBUpdates(): bool {
$title = Title::newFromText( 'Template:Extension DPL' );
$title = $this->getServiceContainer()->getTitleFactory()
->newFromText( 'Template:Extension DPL' );

// Make sure template does not already exist
if ( !$title->exists() ) {
$services = MediaWikiServices::getInstance();
$wikiPageFactory = $services->getWikiPageFactory();
$wikiPageFactory = $this->getServiceContainer()->getWikiPageFactory();
$page = $wikiPageFactory->newFromTitle( $title );

$updater = $page->newPageUpdater( User::newSystemUser( 'DynamicPageList3 extension' ) );
Expand Down

0 comments on commit c30cb8f

Please sign in to comment.