jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380230 )
Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 ...................................................................... build: Updating mediawiki/mediawiki-codesniffer to 13.0.0 The following sniffs are failing and were disabled: * MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle Change-Id: I31932852745645cd76acce9b2b56d8d78a78da4d --- M ProofreadPage.body.php M SpecialPagesWithoutScans.php M composer.json M includes/index/IndexContentHandler.php M includes/index/IndexEditAction.php M includes/index/ProofreadIndexDbConnector.php M includes/page/EditPagePage.php M includes/page/ProofreadPageDbConnector.php M includes/page/ProofreadPagePage.php M phpcs.xml M tests/phpunit/ProofreadPageTestCase.php 11 files changed, 12 insertions(+), 20 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php index dbae3ab..8377fd1 100644 --- a/ProofreadPage.body.php +++ b/ProofreadPage.body.php @@ -21,7 +21,6 @@ use ProofreadPage\Context; use ProofreadPage\FileNotFoundException; -use ProofreadPage\Index\EditIndexPage; use ProofreadPage\Page\PageContent; use ProofreadPage\Page\PageContentBuilder; use ProofreadPage\Pagination\PageNotInPaginationException; diff --git a/SpecialPagesWithoutScans.php b/SpecialPagesWithoutScans.php index a60b085..7299bfc 100644 --- a/SpecialPagesWithoutScans.php +++ b/SpecialPagesWithoutScans.php @@ -77,7 +77,7 @@ } public function getQueryInfo() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); // Construct subqueries $pagesWithScansSubquery = $dbr->selectSQLText( diff --git a/composer.json b/composer.json index c0cdd39..a6aa35f 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "mediawiki/mediawiki-codesniffer": "0.12.0", + "mediawiki/mediawiki-codesniffer": "13.0.0", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { diff --git a/includes/index/IndexContentHandler.php b/includes/index/IndexContentHandler.php index c8c64e9..37f94bf 100644 --- a/includes/index/IndexContentHandler.php +++ b/includes/index/IndexContentHandler.php @@ -7,7 +7,6 @@ use MWContentSerializationException; use Parser; use PPFrame; -use StubObject; use TextContentHandler; use Title; use WikitextContent; diff --git a/includes/index/IndexEditAction.php b/includes/index/IndexEditAction.php index 9a120b3..d2662dc 100644 --- a/includes/index/IndexEditAction.php +++ b/includes/index/IndexEditAction.php @@ -3,8 +3,6 @@ namespace ProofreadPage\Index; use EditAction; -use ProofreadPage\Context; -use ProofreadPagePage; /** * @licence GNU GPL v2+ diff --git a/includes/index/ProofreadIndexDbConnector.php b/includes/index/ProofreadIndexDbConnector.php index 7b452b9..6ff1bc7 100644 --- a/includes/index/ProofreadIndexDbConnector.php +++ b/includes/index/ProofreadIndexDbConnector.php @@ -27,7 +27,7 @@ * @return ResultWrapper */ public static function getRowsFromTitle( Title $title ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $result = $dbr->select( [ 'page', 'pagelinks' ], [ 'page_namespace', 'page_title' ], @@ -150,7 +150,7 @@ * @return Object */ public static function getIndexDataFromIndexTitle( $indexTitle ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->selectRow( [ 'pr_index', 'page' ], [ 'pr_count', 'pr_q0', 'pr_q1', 'pr_q2', 'pr_q3', 'pr_q4' ], @@ -167,7 +167,7 @@ * @return Object */ public static function getIndexDataFromIndexPageId( $indexId ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->selectRow( [ 'pr_index' ], [ 'pr_count', 'pr_q0', 'pr_q1', 'pr_q2', 'pr_q3', 'pr_q4' ], diff --git a/includes/page/EditPagePage.php b/includes/page/EditPagePage.php index 28f19cc..8f6847f 100644 --- a/includes/page/EditPagePage.php +++ b/includes/page/EditPagePage.php @@ -3,7 +3,6 @@ namespace ProofreadPage\Page; use Article; -use ContentHandler; use EditPage; use Html; use MWException; diff --git a/includes/page/ProofreadPageDbConnector.php b/includes/page/ProofreadPageDbConnector.php index 8080a94..c51939e 100644 --- a/includes/page/ProofreadPageDbConnector.php +++ b/includes/page/ProofreadPageDbConnector.php @@ -26,7 +26,7 @@ * @param ResultWrapper */ public static function getCategoryNamesForPageIds( $pageIds ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); return $dbr->select( [ 'categorylinks' ], [ 'cl_from', 'cl_to' ], @@ -41,7 +41,7 @@ * @return ResultWrapper */ public static function getPagesNameInCategory( $pp, $cat ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); return $dbr->select( [ 'page', 'categorylinks' ], [ 'page_title' ], @@ -62,7 +62,7 @@ * @return int */ public static function queryCount( $query, $cat ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $query['conds']['cl_to'] = str_replace( ' ', '_', wfMessage( $cat )->inContentLanguage()->text() ); $res = $dbr->select( @@ -87,7 +87,7 @@ * @return int|null */ public static function getNumberOfExistingPagesFromPageTitle( $pages ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'page' ], [ 'COUNT(page_id) AS count' ], @@ -107,7 +107,7 @@ * @return string|null */ public static function getIndexTitleForPageId( $id ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->selectRow( [ 'templatelinks' ], [ 'tl_title AS title' ], @@ -140,7 +140,7 @@ * @return int|null */ public static function countTransclusionFromPageId( $id ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $res = $dbr->select( [ 'templatelinks', 'page' ], [ 'COUNT(page_id) AS count' ], diff --git a/includes/page/ProofreadPagePage.php b/includes/page/ProofreadPagePage.php index 27cdbde..c2f1cb5 100644 --- a/includes/page/ProofreadPagePage.php +++ b/includes/page/ProofreadPagePage.php @@ -19,9 +19,6 @@ * @ingroup ProofreadPage */ -use ProofreadPage\Context; -use ProofreadPage\FileNotFoundException; - /** * The content of a page page */ diff --git a/phpcs.xml b/phpcs.xml index 97c8950..1ca8a25 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -13,6 +13,7 @@ <exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" /> + <exclude name="MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle" /> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/> </rule> <rule ref="MediaWiki.NamingConventions.ValidGlobalName"> diff --git a/tests/phpunit/ProofreadPageTestCase.php b/tests/phpunit/ProofreadPageTestCase.php index b038ff3..ae74ecb 100644 --- a/tests/phpunit/ProofreadPageTestCase.php +++ b/tests/phpunit/ProofreadPageTestCase.php @@ -5,7 +5,6 @@ use ProofreadPage\FileProviderMock; use ProofreadPage\Index\CustomIndexFieldsParser; use ProofreadPage\Index\IndexContent; -use ProofreadPage\Page\PageContent; use ProofreadPage\ProofreadPageInit; /** -- To view, visit https://gerrit.wikimedia.org/r/380230 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I31932852745645cd76acce9b2b56d8d78a78da4d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: Libraryupgrader <tools.libraryupgra...@tools.wmflabs.org> Gerrit-Reviewer: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits