From ff43e1ecf25de5527e08c81d3f5fd966f3667271 Mon Sep 17 00:00:00 2001 From: libraryupgrader Date: Tue, 14 Jan 2020 05:09:42 +0000 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 29.0.0 The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate * MediaWiki.Commenting.FunctionComment.MissingReturn * MediaWiki.Usage.ForbiddenFunctions.isset * MediaWiki.Usage.PHPUnitDeprecatedMethods.AssertInternalTypeGeneric Additional changes: * Also sorted "composer fix" command to run phpcbf last. Change-Id: I29416247ff3736799543926813beaf4afd569a6e --- .phpcs.xml | 4 ++++ composer.json | 6 +++--- includes/model/Event.php | 4 ++-- includes/ooui/LabelIconWidget.php | 2 +- maintenance/removeInvalidNotification.php | 2 +- tests/phpunit/AttributeManagerTest.php | 4 ++-- tests/phpunit/mapper/NotificationMapperTest.php | 4 ++-- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 556fb987d..22c74e179 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -2,10 +2,14 @@ . + + + + diff --git a/composer.json b/composer.json index a4c741059..2e93039df 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "1.0.0", - "mediawiki/mediawiki-codesniffer": "28.0.0", + "mediawiki/mediawiki-codesniffer": "29.0.0", "jakub-onderka/php-console-highlighter": "0.3.2", "mediawiki/minus-x": "0.3.2", "mediawiki/mediawiki-phan-config": "0.9.0" @@ -13,8 +13,8 @@ "minus-x check ." ], "fix": [ - "phpcbf", - "minus-x fix ." + "minus-x fix .", + "phpcbf" ] }, "extra": { diff --git a/includes/model/Event.php b/includes/model/Event.php index cc4ec98ef..d04ec952e 100644 --- a/includes/model/Event.php +++ b/includes/model/Event.php @@ -1,8 +1,8 @@ extra ) || is_object( $this->extra ) ) { $extra = serialize( $this->extra ); - } elseif ( is_null( $this->extra ) ) { + } elseif ( $this->extra === null ) { $extra = null; } else { $extra = serialize( [ $this->extra ] ); diff --git a/includes/ooui/LabelIconWidget.php b/includes/ooui/LabelIconWidget.php index d3a55d616..940b17211 100644 --- a/includes/ooui/LabelIconWidget.php +++ b/includes/ooui/LabelIconWidget.php @@ -4,8 +4,8 @@ namespace EchoOOUI; use OOUI\IconElement; use OOUI\LabelElement; -use OOUI\TitledElement; use OOUI\Tag; +use OOUI\TitledElement; use OOUI\Widget; /** diff --git a/maintenance/removeInvalidNotification.php b/maintenance/removeInvalidNotification.php index 5310c278e..e6d06aa7f 100644 --- a/maintenance/removeInvalidNotification.php +++ b/maintenance/removeInvalidNotification.php @@ -57,7 +57,7 @@ class RemoveInvalidNotification extends Maintenance { $event[] = $row->event_id; } $count++; - }; + } if ( $event ) { $this->beginTransaction( $dbw, __METHOD__ ); diff --git a/tests/phpunit/AttributeManagerTest.php b/tests/phpunit/AttributeManagerTest.php index 1080696dd..8c8d22f48 100644 --- a/tests/phpunit/AttributeManagerTest.php +++ b/tests/phpunit/AttributeManagerTest.php @@ -437,8 +437,8 @@ class EchoAttributeManagerTest extends MediaWikiTestCase { } /** - @dataProvider isNotifyTypeAvailableForCategoryProvider - */ + * @dataProvider isNotifyTypeAvailableForCategoryProvider + */ public function testIsNotifyTypeAvailableForCategory( $message, $expected, diff --git a/tests/phpunit/mapper/NotificationMapperTest.php b/tests/phpunit/mapper/NotificationMapperTest.php index 6f25ab1b7..27a2698ad 100644 --- a/tests/phpunit/mapper/NotificationMapperTest.php +++ b/tests/phpunit/mapper/NotificationMapperTest.php @@ -42,7 +42,7 @@ class EchoNotificationMapperTest extends MediaWikiTestCase { $notifMapper = new EchoNotificationMapper( $this->mockMWEchoDbFactory( [ 'select' => $dbResult ] ) ); $res = $notifMapper->fetchUnreadByUser( $this->mockUser(), 10, null, '', [ 'test_event' ] ); - $this->assertInternalType( 'array', $res ); + $this->assertIsArray( $res ); $this->assertNotEmpty( $res ); foreach ( $res as $row ) { $this->assertInstanceOf( EchoNotification::class, $row ); @@ -91,7 +91,7 @@ class EchoNotificationMapperTest extends MediaWikiTestCase { ) ); $res = $notifMapper->fetchByUser( $this->mockUser(), 10, '', [ 'test_event' ] ); - $this->assertInternalType( 'array', $res ); + $this->assertIsArray( $res ); $this->assertNotEmpty( $res ); foreach ( $res as $row ) { $this->assertInstanceOf( EchoNotification::class, $row );