This run took 16 seconds.
From e96ec2eb0c4c182435378504614b646fdac20285 Mon Sep 17 00:00:00 2001 From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> Date: Mon, 18 Mar 2024 13:23:27 +0000 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic Change-Id: I5f5f673c7e5b4160a1c786205a8ea0db861e4f29 --- .phpcs.xml | 1 + composer.json | 5 +- includes/PageHierarchyProvider.php | 9 ++-- includes/api/ApiBookshelfBookStore.php | 2 +- maintenance/UserBookContentLanguage.php | 2 +- src/ChapterPager.php | 50 +++++++++---------- .../PrependPageTOCNumbers.php | 2 +- src/ConfigDefinition/SupressBookNS.php | 2 +- src/HookHandler/CommonUserInterface.php | 4 +- src/PageHierarchyProviderFactory.php | 3 +- src/Tag/BookNavHandler.php | 2 +- src/TreeParser.php | 4 +- tests/phpunit/BookHierarchyBuilderTest.php | 4 +- tests/phpunit/HeadingNumberationTest.php | 2 +- tests/phpunit/LineProcessor/PlainTextTest.php | 4 +- tests/phpunit/TOCNumberationTest.php | 2 +- tests/phpunit/TreeParserTest.php | 4 +- 17 files changed, 53 insertions(+), 49 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index d1ac6c9..68f9055 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -2,6 +2,7 @@ <ruleset> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" /> <exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" /> diff --git a/composer.json b/composer.json index 079a132..7eaf434 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } }, "require-dev": { - "mediawiki/mediawiki-codesniffer": "41.0.0", + "mediawiki/mediawiki-codesniffer": "43.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" @@ -34,7 +34,8 @@ }, "config": { "allow-plugins": { - "composer/installers": true + "composer/installers": true, + "dealerdirect/phpcodesniffer-composer-installer": true } } } diff --git a/includes/PageHierarchyProvider.php b/includes/PageHierarchyProvider.php index e051eeb..4207a19 100644 --- a/includes/PageHierarchyProvider.php +++ b/includes/PageHierarchyProvider.php @@ -530,15 +530,16 @@ class PageHierarchyProvider { do { if ( isset( $sText[ $iDepth ] ) && $sText[ $iDepth ] == $this->sIndentChar ) { $iDepth++; - } else { $bIsIndentCharacter = false; + } else { + $bIsIndentCharacter = false; } - } - while ( $bIsIndentCharacter ); + } while ( $bIsIndentCharacter ); $sText = substr( $sText, $iDepth ); // Skip line processing if empty $sText = trim( $sText ); - if ( empty( $sText ) ) { continue; + if ( empty( $sText ) ) { + continue; } if ( $iDepth > $iLevel ) { diff --git a/includes/api/ApiBookshelfBookStore.php b/includes/api/ApiBookshelfBookStore.php index 7dcf363..6c9ac39 100644 --- a/includes/api/ApiBookshelfBookStore.php +++ b/includes/api/ApiBookshelfBookStore.php @@ -19,7 +19,7 @@ class ApiBookshelfBookStore extends BSApiExtJSStoreBase { $aParams = $this->extractRequestParams( false ); $aResult = []; - try{ + try { $oPHP = PageHierarchyProvider::getInstanceFor( $aParams['book'] ); $oTree = $oPHP->getExtendedTOCJSON(); if ( $aParams['node'] && $aParams['node'] !== 'root' ) { diff --git a/maintenance/UserBookContentLanguage.php b/maintenance/UserBookContentLanguage.php index 9afec51..b98cd37 100644 --- a/maintenance/UserBookContentLanguage.php +++ b/maintenance/UserBookContentLanguage.php @@ -107,7 +107,7 @@ class UserBookContentLanguage extends LoggedUpdateMaintenance { */ private function moveBook( Title $title, Title $moveTitle ) { $status = Status::newGood(); - try{ + try { $move = $this->services->getMovePageFactory()->newMovePage( $title, $moveTitle ); $status = $move->move( $this->getMaintenanceUser(), diff --git a/src/ChapterPager.php b/src/ChapterPager.php index a666843..94cba38 100644 --- a/src/ChapterPager.php +++ b/src/ChapterPager.php @@ -177,46 +177,46 @@ class ChapterPager { } $btnTitle = null; - if ( isset( $pageData['chapter_namespace'] ) && isset( $pageData['chapter_title'] ) + if ( isset( $pageData['chapter_namespace'] ) && isset( $pageData['chapter_title'] ) ) { - $btnTitle = $this->titleFactory->makeTitle( + $btnTitle = $this->titleFactory->makeTitle( $pageData['chapter_namespace'], $pageData['chapter_title'] - ); + ); - if ( $label === '' ) { - $label = $btnTitle->getText(); - } - } + if ( $label === '' ) { + $label = $btnTitle->getText(); + } + } - $btnData = []; - if ( $btnTitle ) { - $btnData = [ + $btnData = []; + if ( $btnTitle ) { + $btnData = [ 'class' => "$type-chapter", 'href' => $btnTitle->getFullURL(), 'title' => $pageData['chapter_name'] - ]; - } else { - $btnData = [ + ]; + } else { + $btnData = [ 'class' => "disabled $type-chapter", 'disabled' => 'true' - ]; - } - - $html = Html::openElement( 'a', $btnData ); - /** - * Message keys: - * bs-bookshelfui-chapterpager-next - * bs-bookshelfui-chapterpager-previous - */ - $html .= Html::element( + ]; + } + + $html = Html::openElement( 'a', $btnData ); + /** + * Message keys: + * bs-bookshelfui-chapterpager-next + * bs-bookshelfui-chapterpager-previous + */ + $html .= Html::element( 'span', [], wfMessage( "bs-bookshelfui-chapterpager-$type" )->plain() ); - $html .= Html::closeElement( 'a' ); + $html .= Html::closeElement( 'a' ); - return $html; + return $html; } /** diff --git a/src/ConfigDefinition/PrependPageTOCNumbers.php b/src/ConfigDefinition/PrependPageTOCNumbers.php index 37d2d11..1122e58 100644 --- a/src/ConfigDefinition/PrependPageTOCNumbers.php +++ b/src/ConfigDefinition/PrependPageTOCNumbers.php @@ -13,7 +13,7 @@ class PrependPageTOCNumbers extends BooleanSetting implements \BlueSpice\Bookshe public function getPaths() { return [ static::MAIN_PATH_FEATURE . '/' . static::FEATURE_CONTENT_STRUCTURING . '/BlueSpiceBookshelf', - static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_CONTENT_STRUCTURING , + static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_CONTENT_STRUCTURING, static::MAIN_PATH_PACKAGE . '/' . static::PACKAGE_PRO . '/BlueSpiceBookshelf', ]; } diff --git a/src/ConfigDefinition/SupressBookNS.php b/src/ConfigDefinition/SupressBookNS.php index 66318e2..e9010b0 100644 --- a/src/ConfigDefinition/SupressBookNS.php +++ b/src/ConfigDefinition/SupressBookNS.php @@ -13,7 +13,7 @@ class SupressBookNS extends BooleanSetting implements \BlueSpice\Bookshelf\ISett public function getPaths() { return [ static::MAIN_PATH_FEATURE . '/' . static::FEATURE_EXPORT . '/BlueSpiceBookshelf', - static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_EXPORT , + static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_EXPORT, static::MAIN_PATH_PACKAGE . '/' . static::PACKAGE_PRO . '/BlueSpiceBookshelf', ]; } diff --git a/src/HookHandler/CommonUserInterface.php b/src/HookHandler/CommonUserInterface.php index 8a58303..6ab9d2f 100644 --- a/src/HookHandler/CommonUserInterface.php +++ b/src/HookHandler/CommonUserInterface.php @@ -120,10 +120,10 @@ class CommonUserInterface implements MWStakeCommonUIRegisterSkinSlotComponents { 'factory' => static function () use ( $title, $titleFactory, $bookContextProviderFactory, $bookLookup, $chapterLookup ) { - return new ChapterPagerPanel( + return new ChapterPagerPanel( $title, $titleFactory, $bookContextProviderFactory, $bookLookup, $chapterLookup, 'bs-bookshelfui-chapter-pager-cnt-top' - ); + ); } ] ] diff --git a/src/PageHierarchyProviderFactory.php b/src/PageHierarchyProviderFactory.php index 0776aa2..002fa79 100644 --- a/src/PageHierarchyProviderFactory.php +++ b/src/PageHierarchyProviderFactory.php @@ -81,7 +81,8 @@ class PageHierarchyProviderFactory { */ public function findSuitableSourceArticleReference( $aTags ) { foreach ( $aTags as $aTag ) { - if ( empty( $aTag ) ) { continue; + if ( empty( $aTag ) ) { + continue; } $aAttributes = $aTag['attributes']; $sSourceArticleTitle = ''; diff --git a/src/Tag/BookNavHandler.php b/src/Tag/BookNavHandler.php index a107c1e..1847393 100644 --- a/src/Tag/BookNavHandler.php +++ b/src/Tag/BookNavHandler.php @@ -80,7 +80,7 @@ class BookNavHandler extends Handler { ] ); $bookNav .= Html::element( 'h2', [ 'style' => 'width: 80%; margin: 0; padding: 0;' - ], $bookTitle->getText() + ], $bookTitle->getText() ); $bookNav .= $this->buildSearchBox(); $bookNav .= Html::closeElement( 'div' ); diff --git a/src/TreeParser.php b/src/TreeParser.php index e7d28a6..92b25bc 100644 --- a/src/TreeParser.php +++ b/src/TreeParser.php @@ -156,10 +156,10 @@ class TreeParser { while ( $depth < $level ) { array_pop( $number ); $level--; - $number[$level - 1] ++; + $number[$level - 1]++; } } else { - $number[$level - 1] ++; + $number[$level - 1]++; } $this->simpleTOC[] = [ 'number-array' => $number, diff --git a/tests/phpunit/BookHierarchyBuilderTest.php b/tests/phpunit/BookHierarchyBuilderTest.php index 9e00658..9bf58ec 100644 --- a/tests/phpunit/BookHierarchyBuilderTest.php +++ b/tests/phpunit/BookHierarchyBuilderTest.php @@ -35,7 +35,7 @@ class BookHierarchyBuilderTest extends TestCase { * @return array */ private function getExpected(): array { - return [ + return [ [ 'chapter_namespace' => '0', 'chapter_title' => 'Test_chap_A', @@ -111,7 +111,7 @@ class BookHierarchyBuilderTest extends TestCase { ] ] ], - ]; + ]; } /** diff --git a/tests/phpunit/HeadingNumberationTest.php b/tests/phpunit/HeadingNumberationTest.php index 6f08b33..1217953 100644 --- a/tests/phpunit/HeadingNumberationTest.php +++ b/tests/phpunit/HeadingNumberationTest.php @@ -15,7 +15,7 @@ use PHPUnit\Framework\TestCase; class HeadingNumberationTest extends TestCase { /** - * @covers HeadingNumberation::execute + * @covers \BlueSpice\Bookshelf\HeadingNumberation::execute */ public function testExecute() { $input = file_get_contents( __DIR__ . '/data/heading_numberation_input.html' ); diff --git a/tests/phpunit/LineProcessor/PlainTextTest.php b/tests/phpunit/LineProcessor/PlainTextTest.php index 71ee321..a34b447 100644 --- a/tests/phpunit/LineProcessor/PlainTextTest.php +++ b/tests/phpunit/LineProcessor/PlainTextTest.php @@ -16,7 +16,7 @@ class PlainTextTest extends TestCase { /** * @param string $line * @param string $message - * @covers PlainText::applies + * @covers \BlueSpice\Bookshelf\LineProcessor\PlainText::applies * @dataProvider provideTestAppliesData */ public function testApplies( $line, $message ) { @@ -40,7 +40,7 @@ class PlainTextTest extends TestCase { /** * * @param string $line - * @covers PlainText::process + * @covers \BlueSpice\Bookshelf\LineProcessor\PlainText::process * @dataProvider provideTestProcessData */ public function testProcess( $line ) { diff --git a/tests/phpunit/TOCNumberationTest.php b/tests/phpunit/TOCNumberationTest.php index 5d2fe77..7738151 100644 --- a/tests/phpunit/TOCNumberationTest.php +++ b/tests/phpunit/TOCNumberationTest.php @@ -15,7 +15,7 @@ use PHPUnit\Framework\TestCase; class TOCNumberationTest extends TestCase { /** - * @covers TOCNumberation::execute + * @covers \BlueSpice\Bookshelf\TOCNumberation::execute */ public function testExecute() { $input = file_get_contents( __DIR__ . '/data/toc_numberation_input.html' ); diff --git a/tests/phpunit/TreeParserTest.php b/tests/phpunit/TreeParserTest.php index 9be3418..084cfab 100644 --- a/tests/phpunit/TreeParserTest.php +++ b/tests/phpunit/TreeParserTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; class TreeParserTest extends TestCase { /** - * @covers TreeParser::__construct + * @covers \BlueSpice\Bookshelf\TreeParser::__construct */ public function testContructor() { $mockConfig = $this->createMock( 'Config' ); @@ -32,7 +32,7 @@ class TreeParserTest extends TestCase { } /** - * @covers TreeParser::parseWikiTextList + * @covers \BlueSpice\Bookshelf\TreeParser::parseWikiTextList * @dataProvider provideParseWikiTextListData */ public function testParseWikiTextList( $wikiText, $expectedTree ) { -- 2.39.2
$ date --- stdout --- Mon Mar 18 13:23:17 UTC 2024 --- end --- $ git clone file:///srv/git/mediawiki-extensions-BlueSpiceBookshelf.git repo --depth=1 -b master --- stderr --- Cloning into 'repo'... --- stdout --- --- end --- $ git config user.name libraryupgrader --- stdout --- --- end --- $ git config user.email tools.libraryupgrader@tools.wmflabs.org --- stdout --- --- end --- $ git submodule update --init --- stdout --- --- end --- $ grr init --- stdout --- Installed commit-msg hook. --- end --- $ git show-ref refs/heads/master --- stdout --- 81c2bb9d6152d04455495c604ed3ab6c4a6c9df4 refs/heads/master --- end --- $ /usr/bin/npm audit --json --- stdout --- { "auditReportVersion": 2, "vulnerabilities": {}, "metadata": { "vulnerabilities": { "info": 0, "low": 0, "moderate": 0, "high": 0, "critical": 0, "total": 0 }, "dependencies": { "prod": 1, "dev": 321, "optional": 0, "peer": 1, "peerOptional": 0, "total": 321 } } } --- end --- $ /usr/bin/composer install --- stderr --- No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information. Loading composer repositories with package information Updating dependencies Lock file operations: 20 installs, 0 updates, 0 removals - Locking composer/installers (v2.2.0) - Locking composer/semver (3.3.2) - Locking composer/spdx-licenses (1.5.8) - Locking mediawiki/mediawiki-codesniffer (v41.0.0) - Locking mediawiki/minus-x (1.1.1) - Locking php-parallel-lint/php-console-color (v1.0.1) - Locking php-parallel-lint/php-console-highlighter (v1.0.0) - Locking php-parallel-lint/php-parallel-lint (v1.3.2) - Locking psr/container (2.0.2) - Locking squizlabs/php_codesniffer (3.7.2) - Locking symfony/console (v5.4.36) - Locking symfony/deprecation-contracts (v3.4.0) - Locking symfony/polyfill-ctype (v1.29.0) - Locking symfony/polyfill-intl-grapheme (v1.29.0) - Locking symfony/polyfill-intl-normalizer (v1.29.0) - Locking symfony/polyfill-mbstring (v1.29.0) - Locking symfony/polyfill-php73 (v1.29.0) - Locking symfony/polyfill-php80 (v1.29.0) - Locking symfony/service-contracts (v3.4.1) - Locking symfony/string (v6.4.4) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 20 installs, 0 updates, 0 removals 0 [>---------------------------] 0 [->--------------------------] - Installing composer/installers (v2.2.0): Extracting archive - Installing symfony/polyfill-php80 (v1.29.0): Extracting archive - Installing squizlabs/php_codesniffer (3.7.2): Extracting archive - Installing symfony/polyfill-mbstring (v1.29.0): Extracting archive - Installing composer/spdx-licenses (1.5.8): Extracting archive - Installing composer/semver (3.3.2): Extracting archive - Installing mediawiki/mediawiki-codesniffer (v41.0.0): Extracting archive - Installing symfony/polyfill-intl-normalizer (v1.29.0): Extracting archive - Installing symfony/polyfill-intl-grapheme (v1.29.0): Extracting archive - Installing symfony/polyfill-ctype (v1.29.0): Extracting archive - Installing symfony/string (v6.4.4): Extracting archive - Installing psr/container (2.0.2): Extracting archive - Installing symfony/service-contracts (v3.4.1): Extracting archive - Installing symfony/polyfill-php73 (v1.29.0): Extracting archive - Installing symfony/deprecation-contracts (v3.4.0): Extracting archive - Installing symfony/console (v5.4.36): Extracting archive - Installing mediawiki/minus-x (1.1.1): Extracting archive - Installing php-parallel-lint/php-console-color (v1.0.1): Extracting archive - Installing php-parallel-lint/php-console-highlighter (v1.0.0): Extracting archive - Installing php-parallel-lint/php-parallel-lint (v1.3.2): Extracting archive 0/19 [>---------------------------] 0% 18/19 [==========================>-] 94% 19/19 [============================] 100% 4 package suggestions were added by new dependencies, use `composer suggest` to see details. Generating autoload files 14 packages you are using are looking for funding. Use the `composer fund` command to find out more! --- stdout --- --- end --- Upgrading c:mediawiki/mediawiki-codesniffer from 41.0.0 -> 43.0.0 $ /usr/bin/composer update --- stderr --- Loading composer repositories with package information Updating dependencies Lock file operations: 3 installs, 3 updates, 0 removals - Upgrading composer/semver (3.3.2 => 3.4.0) - Locking dealerdirect/phpcodesniffer-composer-installer (v1.0.0) - Upgrading mediawiki/mediawiki-codesniffer (v41.0.0 => v43.0.0) - Locking phpcsstandards/phpcsextra (1.1.2) - Locking phpcsstandards/phpcsutils (1.0.9) - Upgrading squizlabs/php_codesniffer (3.7.2 => 3.8.1) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 3 installs, 3 updates, 0 removals 0 [>---------------------------] 0 [->--------------------------] - Upgrading squizlabs/php_codesniffer (3.7.2 => 3.8.1): Extracting archive - Installing dealerdirect/phpcodesniffer-composer-installer (v1.0.0): Extracting archive - Installing phpcsstandards/phpcsutils (1.0.9): Extracting archive - Installing phpcsstandards/phpcsextra (1.1.2): Extracting archive - Upgrading composer/semver (3.3.2 => 3.4.0): Extracting archive - Upgrading mediawiki/mediawiki-codesniffer (v41.0.0 => v43.0.0): Extracting archive 0/4 [>---------------------------] 0% 4/4 [============================] 100% Generating autoload files 15 packages you are using are looking for funding. Use the `composer fund` command to find out more! No security vulnerability advisories found --- stdout --- PHP CodeSniffer Config installed_paths set to ../../mediawiki/mediawiki-codesniffer,../../phpcsstandards/phpcsextra,../../phpcsstandards/phpcsutils --- end --- {'MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName', 'MediaWiki.Commenting.FunctionComment.WrongStyle', 'MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected', 'MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate', 'MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate'} Tests fail! $ vendor/bin/phpcbf --- stdout --- PHPCBF RESULT SUMMARY ----------------------------------------------------------------------------- FILE FIXED REMAINING ----------------------------------------------------------------------------- /src/repo/tests/phpunit/TOCNumberationTest.php 1 0 /src/repo/tests/phpunit/LineProcessor/PlainTextTest.php 2 0 /src/repo/includes/api/ApiBookshelfBookStore.php 1 1 /src/repo/tests/phpunit/BookHierarchyBuilderTest.php 2 0 /src/repo/tests/phpunit/TreeParserTest.php 2 0 /src/repo/tests/phpunit/HeadingNumberationTest.php 1 0 /src/repo/src/HookHandler/CommonUserInterface.php 2 0 /src/repo/maintenance/UserBookContentLanguage.php 1 0 /src/repo/src/ChapterPager.php 20 0 /src/repo/src/Tag/BookNavHandler.php 1 0 /src/repo/src/ConfigDefinition/SupressBookNS.php 1 0 /src/repo/src/TreeParser.php 2 1 /src/repo/src/PageHierarchyProviderFactory.php 1 1 /src/repo/src/ConfigDefinition/PrependPageTOCNumbers.php 1 0 /src/repo/includes/PageHierarchyProvider.php 3 0 ----------------------------------------------------------------------------- A TOTAL OF 41 ERRORS WERE FIXED IN 15 FILES ----------------------------------------------------------------------------- Time: 853ms; Memory: 6MB --- end --- $ git checkout .phpcs.xml --- stderr --- Updated 1 path from the index --- stdout --- --- end --- $ /usr/bin/composer install --- stderr --- Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Nothing to install, update or remove Generating autoload files 15 packages you are using are looking for funding. Use the `composer fund` command to find out more! --- stdout --- --- end --- $ /usr/bin/composer test --- stderr --- > parallel-lint . --exclude vendor --exclude node_modules > minus-x check . > phpcs -sp --cache --- stdout --- PHP 8.2.7 | 10 parallel jobs ............................................................ 60/141 (42 %) ............................................................ 120/141 (85 %) ..................... 141/141 (100 %) Checked 141 files in 0.7 seconds No syntax error found MinusX ====== Processing /src/repo... ............................................................. ............................................................. ............................................................. ............................................................. ............................................................. ............................................................. ............................................................. ............................................................. .... All good! ............................................... 47 / 47 (100%) Time: 322ms; Memory: 12MB --- end --- $ /usr/bin/npm audit --json --- stdout --- { "auditReportVersion": 2, "vulnerabilities": {}, "metadata": { "vulnerabilities": { "info": 0, "low": 0, "moderate": 0, "high": 0, "critical": 0, "total": 0 }, "dependencies": { "prod": 1, "dev": 321, "optional": 0, "peer": 1, "peerOptional": 0, "total": 321 } } } --- end --- $ package-lock-lint package-lock.json --- stdout --- Checking package-lock.json --- end --- build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic $ git add . --- stdout --- --- end --- $ git commit -F /tmp/tmpzligpa90 --- stdout --- [master e96ec2e] build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 17 files changed, 53 insertions(+), 49 deletions(-) --- end --- $ git format-patch HEAD~1 --stdout --- stdout --- From e96ec2eb0c4c182435378504614b646fdac20285 Mon Sep 17 00:00:00 2001 From: libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> Date: Mon, 18 Mar 2024 13:23:27 +0000 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic Change-Id: I5f5f673c7e5b4160a1c786205a8ea0db861e4f29 --- .phpcs.xml | 1 + composer.json | 5 +- includes/PageHierarchyProvider.php | 9 ++-- includes/api/ApiBookshelfBookStore.php | 2 +- maintenance/UserBookContentLanguage.php | 2 +- src/ChapterPager.php | 50 +++++++++---------- .../PrependPageTOCNumbers.php | 2 +- src/ConfigDefinition/SupressBookNS.php | 2 +- src/HookHandler/CommonUserInterface.php | 4 +- src/PageHierarchyProviderFactory.php | 3 +- src/Tag/BookNavHandler.php | 2 +- src/TreeParser.php | 4 +- tests/phpunit/BookHierarchyBuilderTest.php | 4 +- tests/phpunit/HeadingNumberationTest.php | 2 +- tests/phpunit/LineProcessor/PlainTextTest.php | 4 +- tests/phpunit/TOCNumberationTest.php | 2 +- tests/phpunit/TreeParserTest.php | 4 +- 17 files changed, 53 insertions(+), 49 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index d1ac6c9..68f9055 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -2,6 +2,7 @@ <ruleset> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" /> + <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" /> <exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" /> diff --git a/composer.json b/composer.json index 079a132..7eaf434 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } }, "require-dev": { - "mediawiki/mediawiki-codesniffer": "41.0.0", + "mediawiki/mediawiki-codesniffer": "43.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" @@ -34,7 +34,8 @@ }, "config": { "allow-plugins": { - "composer/installers": true + "composer/installers": true, + "dealerdirect/phpcodesniffer-composer-installer": true } } } diff --git a/includes/PageHierarchyProvider.php b/includes/PageHierarchyProvider.php index e051eeb..4207a19 100644 --- a/includes/PageHierarchyProvider.php +++ b/includes/PageHierarchyProvider.php @@ -530,15 +530,16 @@ class PageHierarchyProvider { do { if ( isset( $sText[ $iDepth ] ) && $sText[ $iDepth ] == $this->sIndentChar ) { $iDepth++; - } else { $bIsIndentCharacter = false; + } else { + $bIsIndentCharacter = false; } - } - while ( $bIsIndentCharacter ); + } while ( $bIsIndentCharacter ); $sText = substr( $sText, $iDepth ); // Skip line processing if empty $sText = trim( $sText ); - if ( empty( $sText ) ) { continue; + if ( empty( $sText ) ) { + continue; } if ( $iDepth > $iLevel ) { diff --git a/includes/api/ApiBookshelfBookStore.php b/includes/api/ApiBookshelfBookStore.php index 7dcf363..6c9ac39 100644 --- a/includes/api/ApiBookshelfBookStore.php +++ b/includes/api/ApiBookshelfBookStore.php @@ -19,7 +19,7 @@ class ApiBookshelfBookStore extends BSApiExtJSStoreBase { $aParams = $this->extractRequestParams( false ); $aResult = []; - try{ + try { $oPHP = PageHierarchyProvider::getInstanceFor( $aParams['book'] ); $oTree = $oPHP->getExtendedTOCJSON(); if ( $aParams['node'] && $aParams['node'] !== 'root' ) { diff --git a/maintenance/UserBookContentLanguage.php b/maintenance/UserBookContentLanguage.php index 9afec51..b98cd37 100644 --- a/maintenance/UserBookContentLanguage.php +++ b/maintenance/UserBookContentLanguage.php @@ -107,7 +107,7 @@ class UserBookContentLanguage extends LoggedUpdateMaintenance { */ private function moveBook( Title $title, Title $moveTitle ) { $status = Status::newGood(); - try{ + try { $move = $this->services->getMovePageFactory()->newMovePage( $title, $moveTitle ); $status = $move->move( $this->getMaintenanceUser(), diff --git a/src/ChapterPager.php b/src/ChapterPager.php index a666843..94cba38 100644 --- a/src/ChapterPager.php +++ b/src/ChapterPager.php @@ -177,46 +177,46 @@ class ChapterPager { } $btnTitle = null; - if ( isset( $pageData['chapter_namespace'] ) && isset( $pageData['chapter_title'] ) + if ( isset( $pageData['chapter_namespace'] ) && isset( $pageData['chapter_title'] ) ) { - $btnTitle = $this->titleFactory->makeTitle( + $btnTitle = $this->titleFactory->makeTitle( $pageData['chapter_namespace'], $pageData['chapter_title'] - ); + ); - if ( $label === '' ) { - $label = $btnTitle->getText(); - } - } + if ( $label === '' ) { + $label = $btnTitle->getText(); + } + } - $btnData = []; - if ( $btnTitle ) { - $btnData = [ + $btnData = []; + if ( $btnTitle ) { + $btnData = [ 'class' => "$type-chapter", 'href' => $btnTitle->getFullURL(), 'title' => $pageData['chapter_name'] - ]; - } else { - $btnData = [ + ]; + } else { + $btnData = [ 'class' => "disabled $type-chapter", 'disabled' => 'true' - ]; - } - - $html = Html::openElement( 'a', $btnData ); - /** - * Message keys: - * bs-bookshelfui-chapterpager-next - * bs-bookshelfui-chapterpager-previous - */ - $html .= Html::element( + ]; + } + + $html = Html::openElement( 'a', $btnData ); + /** + * Message keys: + * bs-bookshelfui-chapterpager-next + * bs-bookshelfui-chapterpager-previous + */ + $html .= Html::element( 'span', [], wfMessage( "bs-bookshelfui-chapterpager-$type" )->plain() ); - $html .= Html::closeElement( 'a' ); + $html .= Html::closeElement( 'a' ); - return $html; + return $html; } /** diff --git a/src/ConfigDefinition/PrependPageTOCNumbers.php b/src/ConfigDefinition/PrependPageTOCNumbers.php index 37d2d11..1122e58 100644 --- a/src/ConfigDefinition/PrependPageTOCNumbers.php +++ b/src/ConfigDefinition/PrependPageTOCNumbers.php @@ -13,7 +13,7 @@ class PrependPageTOCNumbers extends BooleanSetting implements \BlueSpice\Bookshe public function getPaths() { return [ static::MAIN_PATH_FEATURE . '/' . static::FEATURE_CONTENT_STRUCTURING . '/BlueSpiceBookshelf', - static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_CONTENT_STRUCTURING , + static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_CONTENT_STRUCTURING, static::MAIN_PATH_PACKAGE . '/' . static::PACKAGE_PRO . '/BlueSpiceBookshelf', ]; } diff --git a/src/ConfigDefinition/SupressBookNS.php b/src/ConfigDefinition/SupressBookNS.php index 66318e2..e9010b0 100644 --- a/src/ConfigDefinition/SupressBookNS.php +++ b/src/ConfigDefinition/SupressBookNS.php @@ -13,7 +13,7 @@ class SupressBookNS extends BooleanSetting implements \BlueSpice\Bookshelf\ISett public function getPaths() { return [ static::MAIN_PATH_FEATURE . '/' . static::FEATURE_EXPORT . '/BlueSpiceBookshelf', - static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_EXPORT , + static::MAIN_PATH_EXTENSION . '/BlueSpiceBookshelf/' . static::FEATURE_EXPORT, static::MAIN_PATH_PACKAGE . '/' . static::PACKAGE_PRO . '/BlueSpiceBookshelf', ]; } diff --git a/src/HookHandler/CommonUserInterface.php b/src/HookHandler/CommonUserInterface.php index 8a58303..6ab9d2f 100644 --- a/src/HookHandler/CommonUserInterface.php +++ b/src/HookHandler/CommonUserInterface.php @@ -120,10 +120,10 @@ class CommonUserInterface implements MWStakeCommonUIRegisterSkinSlotComponents { 'factory' => static function () use ( $title, $titleFactory, $bookContextProviderFactory, $bookLookup, $chapterLookup ) { - return new ChapterPagerPanel( + return new ChapterPagerPanel( $title, $titleFactory, $bookContextProviderFactory, $bookLookup, $chapterLookup, 'bs-bookshelfui-chapter-pager-cnt-top' - ); + ); } ] ] diff --git a/src/PageHierarchyProviderFactory.php b/src/PageHierarchyProviderFactory.php index 0776aa2..002fa79 100644 --- a/src/PageHierarchyProviderFactory.php +++ b/src/PageHierarchyProviderFactory.php @@ -81,7 +81,8 @@ class PageHierarchyProviderFactory { */ public function findSuitableSourceArticleReference( $aTags ) { foreach ( $aTags as $aTag ) { - if ( empty( $aTag ) ) { continue; + if ( empty( $aTag ) ) { + continue; } $aAttributes = $aTag['attributes']; $sSourceArticleTitle = ''; diff --git a/src/Tag/BookNavHandler.php b/src/Tag/BookNavHandler.php index a107c1e..1847393 100644 --- a/src/Tag/BookNavHandler.php +++ b/src/Tag/BookNavHandler.php @@ -80,7 +80,7 @@ class BookNavHandler extends Handler { ] ); $bookNav .= Html::element( 'h2', [ 'style' => 'width: 80%; margin: 0; padding: 0;' - ], $bookTitle->getText() + ], $bookTitle->getText() ); $bookNav .= $this->buildSearchBox(); $bookNav .= Html::closeElement( 'div' ); diff --git a/src/TreeParser.php b/src/TreeParser.php index e7d28a6..92b25bc 100644 --- a/src/TreeParser.php +++ b/src/TreeParser.php @@ -156,10 +156,10 @@ class TreeParser { while ( $depth < $level ) { array_pop( $number ); $level--; - $number[$level - 1] ++; + $number[$level - 1]++; } } else { - $number[$level - 1] ++; + $number[$level - 1]++; } $this->simpleTOC[] = [ 'number-array' => $number, diff --git a/tests/phpunit/BookHierarchyBuilderTest.php b/tests/phpunit/BookHierarchyBuilderTest.php index 9e00658..9bf58ec 100644 --- a/tests/phpunit/BookHierarchyBuilderTest.php +++ b/tests/phpunit/BookHierarchyBuilderTest.php @@ -35,7 +35,7 @@ class BookHierarchyBuilderTest extends TestCase { * @return array */ private function getExpected(): array { - return [ + return [ [ 'chapter_namespace' => '0', 'chapter_title' => 'Test_chap_A', @@ -111,7 +111,7 @@ class BookHierarchyBuilderTest extends TestCase { ] ] ], - ]; + ]; } /** diff --git a/tests/phpunit/HeadingNumberationTest.php b/tests/phpunit/HeadingNumberationTest.php index 6f08b33..1217953 100644 --- a/tests/phpunit/HeadingNumberationTest.php +++ b/tests/phpunit/HeadingNumberationTest.php @@ -15,7 +15,7 @@ use PHPUnit\Framework\TestCase; class HeadingNumberationTest extends TestCase { /** - * @covers HeadingNumberation::execute + * @covers \BlueSpice\Bookshelf\HeadingNumberation::execute */ public function testExecute() { $input = file_get_contents( __DIR__ . '/data/heading_numberation_input.html' ); diff --git a/tests/phpunit/LineProcessor/PlainTextTest.php b/tests/phpunit/LineProcessor/PlainTextTest.php index 71ee321..a34b447 100644 --- a/tests/phpunit/LineProcessor/PlainTextTest.php +++ b/tests/phpunit/LineProcessor/PlainTextTest.php @@ -16,7 +16,7 @@ class PlainTextTest extends TestCase { /** * @param string $line * @param string $message - * @covers PlainText::applies + * @covers \BlueSpice\Bookshelf\LineProcessor\PlainText::applies * @dataProvider provideTestAppliesData */ public function testApplies( $line, $message ) { @@ -40,7 +40,7 @@ class PlainTextTest extends TestCase { /** * * @param string $line - * @covers PlainText::process + * @covers \BlueSpice\Bookshelf\LineProcessor\PlainText::process * @dataProvider provideTestProcessData */ public function testProcess( $line ) { diff --git a/tests/phpunit/TOCNumberationTest.php b/tests/phpunit/TOCNumberationTest.php index 5d2fe77..7738151 100644 --- a/tests/phpunit/TOCNumberationTest.php +++ b/tests/phpunit/TOCNumberationTest.php @@ -15,7 +15,7 @@ use PHPUnit\Framework\TestCase; class TOCNumberationTest extends TestCase { /** - * @covers TOCNumberation::execute + * @covers \BlueSpice\Bookshelf\TOCNumberation::execute */ public function testExecute() { $input = file_get_contents( __DIR__ . '/data/toc_numberation_input.html' ); diff --git a/tests/phpunit/TreeParserTest.php b/tests/phpunit/TreeParserTest.php index 9be3418..084cfab 100644 --- a/tests/phpunit/TreeParserTest.php +++ b/tests/phpunit/TreeParserTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; class TreeParserTest extends TestCase { /** - * @covers TreeParser::__construct + * @covers \BlueSpice\Bookshelf\TreeParser::__construct */ public function testContructor() { $mockConfig = $this->createMock( 'Config' ); @@ -32,7 +32,7 @@ class TreeParserTest extends TestCase { } /** - * @covers TreeParser::parseWikiTextList + * @covers \BlueSpice\Bookshelf\TreeParser::parseWikiTextList * @dataProvider provideParseWikiTextListData */ public function testParseWikiTextList( $wikiText, $expectedTree ) { -- 2.39.2 --- end ---