diff --git a/bootstrap.php b/bootstrap.php index 6970f22..1495a85 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,6 +1,5 @@ getDBLoadBalancer(); $titleIndexUpdater = new \MWStake\MediaWiki\Component\CommonWebAPIs\TitleIndexUpdater( $lb ); $userIndexUpdater = new \MWStake\MediaWiki\Component\CommonWebAPIs\UserIndexUpdater( $lb ); diff --git a/composer.json b/composer.json index ec7b056..7ea50ed 100644 --- a/composer.json +++ b/composer.json @@ -15,11 +15,11 @@ "mwstake/mediawiki-component-utils": "~2" }, "require-dev": { - "jakub-onderka/php-parallel-lint": "1.0.0", - "jakub-onderka/php-console-highlighter": "0.4.0", - "mediawiki/mediawiki-codesniffer": "29.0.0", - "mediawiki/minus-x": "1.0.0", - "phpunit/phpunit": "^6.5" + "mediawiki/mediawiki-codesniffer": "39.0.0", + "mediawiki/minus-x": "1.1.1", + "php-parallel-lint/php-console-highlighter": "1.0.0", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpunit/phpunit": "^8.5" }, "autoload": { "psr-4": { diff --git a/src/Maintenance/PopulateTitleIndex.php b/src/Maintenance/PopulateTitleIndex.php index 87b7de1..0077277 100644 --- a/src/Maintenance/PopulateTitleIndex.php +++ b/src/Maintenance/PopulateTitleIndex.php @@ -40,6 +40,9 @@ protected function doDBUpdates() { return true; } + /** + * @param array $batch + */ private function insertBatch( array $batch ) { $db = $this->getDB( DB_PRIMARY ); $db->insert( diff --git a/src/Rest/FileQueryStore.php b/src/Rest/FileQueryStore.php index 45b78c9..ff613cd 100644 --- a/src/Rest/FileQueryStore.php +++ b/src/Rest/FileQueryStore.php @@ -29,7 +29,7 @@ public function __construct( /** * @return IStore */ - protected function getStore() : IStore { + protected function getStore(): IStore { return $this->store; } } diff --git a/src/Rest/GroupStore.php b/src/Rest/GroupStore.php index 88d3910..76a3596 100644 --- a/src/Rest/GroupStore.php +++ b/src/Rest/GroupStore.php @@ -27,7 +27,7 @@ public function __construct( /** * @return IStore */ - protected function getStore() : IStore { + protected function getStore(): IStore { return $this->store; } } diff --git a/src/Rest/TitleQueryStore.php b/src/Rest/TitleQueryStore.php index c52fe4a..7371d9d 100644 --- a/src/Rest/TitleQueryStore.php +++ b/src/Rest/TitleQueryStore.php @@ -29,7 +29,7 @@ public function __construct( /** * @return IStore */ - protected function getStore() : IStore { + protected function getStore(): IStore { return $this->store; } } diff --git a/src/Rest/UserQueryStore.php b/src/Rest/UserQueryStore.php index 3727ea5..84e278b 100644 --- a/src/Rest/UserQueryStore.php +++ b/src/Rest/UserQueryStore.php @@ -33,7 +33,7 @@ public function __construct( /** * @return IStore */ - protected function getStore() : IStore { + protected function getStore(): IStore { return $this->store; } } diff --git a/src/TitleIndexUpdater.php b/src/TitleIndexUpdater.php index f0c47eb..55537e6 100644 --- a/src/TitleIndexUpdater.php +++ b/src/TitleIndexUpdater.php @@ -7,16 +7,15 @@ use MediaWiki\Hook\PageMoveCompleteHook; use MediaWiki\Page\Hook\ArticleUndeleteHook; use MediaWiki\Page\Hook\PageDeleteCompleteHook; -use MediaWiki\Page\Hook\PageUndeleteHook; use MediaWiki\Page\PageIdentity; use MediaWiki\Page\ProperPageIdentity; use MediaWiki\Permissions\Authority; use MediaWiki\Revision\RevisionRecord; use MediaWiki\Storage\Hook\PageSaveCompleteHook; -use StatusValue; use Wikimedia\Rdbms\ILoadBalancer; -class TitleIndexUpdater implements PageSaveCompleteHook, +class TitleIndexUpdater implements + PageSaveCompleteHook, PageMoveCompleteHook, PageDeleteCompleteHook, ArticleUndeleteHook, @@ -81,6 +80,7 @@ public function onAfterImportPage( $title, $foreignTitle, $revCount, $sRevCount, /** * @param PageIdentity $page + * @param int|null $forceId (optional) * * @return bool|void */