Merge "build: Updating mediawiki/mediawiki-codesniffer to 29.0.0"

This commit is contained in:
jenkins-bot 2020-01-14 15:52:16 +00:00 committed by Gerrit Code Review
commit 5fcc43d615
7 changed files with 15 additions and 11 deletions

View file

@ -2,10 +2,14 @@
<ruleset name="MediaWiki"> <ruleset name="MediaWiki">
<file>.</file> <file>.</file>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" /> <exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
<exclude name="MediaWiki.Usage.ForbiddenFunctions.isset" />
<exclude name="MediaWiki.Usage.PHPUnitDeprecatedMethods.AssertInternalTypeGeneric" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" /> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" /> <exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
</rule> </rule>

View file

@ -1,7 +1,7 @@
{ {
"require-dev": { "require-dev": {
"jakub-onderka/php-parallel-lint": "1.0.0", "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", "jakub-onderka/php-console-highlighter": "0.3.2",
"mediawiki/minus-x": "0.3.2", "mediawiki/minus-x": "0.3.2",
"mediawiki/mediawiki-phan-config": "0.9.0" "mediawiki/mediawiki-phan-config": "0.9.0"
@ -13,8 +13,8 @@
"minus-x check ." "minus-x check ."
], ],
"fix": [ "fix": [
"phpcbf", "minus-x fix .",
"minus-x fix ." "phpcbf"
] ]
}, },
"extra": { "extra": {

View file

@ -1,8 +1,8 @@
<?php <?php
use MediaWiki\Logger\LoggerFactory; use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
/** /**
* Immutable class to represent an event. * Immutable class to represent an event.
@ -400,7 +400,7 @@ class EchoEvent extends EchoAbstractEntity implements Bundleable {
public function serializeExtra() { public function serializeExtra() {
if ( is_array( $this->extra ) || is_object( $this->extra ) ) { if ( is_array( $this->extra ) || is_object( $this->extra ) ) {
$extra = serialize( $this->extra ); $extra = serialize( $this->extra );
} elseif ( is_null( $this->extra ) ) { } elseif ( $this->extra === null ) {
$extra = null; $extra = null;
} else { } else {
$extra = serialize( [ $this->extra ] ); $extra = serialize( [ $this->extra ] );

View file

@ -4,8 +4,8 @@ namespace EchoOOUI;
use OOUI\IconElement; use OOUI\IconElement;
use OOUI\LabelElement; use OOUI\LabelElement;
use OOUI\TitledElement;
use OOUI\Tag; use OOUI\Tag;
use OOUI\TitledElement;
use OOUI\Widget; use OOUI\Widget;
/** /**

View file

@ -57,7 +57,7 @@ class RemoveInvalidNotification extends Maintenance {
$event[] = $row->event_id; $event[] = $row->event_id;
} }
$count++; $count++;
}; }
if ( $event ) { if ( $event ) {
$this->beginTransaction( $dbw, __METHOD__ ); $this->beginTransaction( $dbw, __METHOD__ );

View file

@ -437,8 +437,8 @@ class EchoAttributeManagerTest extends MediaWikiTestCase {
} }
/** /**
@dataProvider isNotifyTypeAvailableForCategoryProvider * @dataProvider isNotifyTypeAvailableForCategoryProvider
*/ */
public function testIsNotifyTypeAvailableForCategory( public function testIsNotifyTypeAvailableForCategory(
$message, $message,
$expected, $expected,

View file

@ -42,7 +42,7 @@ class EchoNotificationMapperTest extends MediaWikiTestCase {
$notifMapper = new EchoNotificationMapper( $this->mockMWEchoDbFactory( [ 'select' => $dbResult ] ) ); $notifMapper = new EchoNotificationMapper( $this->mockMWEchoDbFactory( [ 'select' => $dbResult ] ) );
$res = $notifMapper->fetchUnreadByUser( $this->mockUser(), 10, null, '', [ 'test_event' ] ); $res = $notifMapper->fetchUnreadByUser( $this->mockUser(), 10, null, '', [ 'test_event' ] );
$this->assertInternalType( 'array', $res ); $this->assertIsArray( $res );
$this->assertNotEmpty( $res ); $this->assertNotEmpty( $res );
foreach ( $res as $row ) { foreach ( $res as $row ) {
$this->assertInstanceOf( EchoNotification::class, $row ); $this->assertInstanceOf( EchoNotification::class, $row );
@ -91,7 +91,7 @@ class EchoNotificationMapperTest extends MediaWikiTestCase {
) )
); );
$res = $notifMapper->fetchByUser( $this->mockUser(), 10, '', [ 'test_event' ] ); $res = $notifMapper->fetchByUser( $this->mockUser(), 10, '', [ 'test_event' ] );
$this->assertInternalType( 'array', $res ); $this->assertIsArray( $res );
$this->assertNotEmpty( $res ); $this->assertNotEmpty( $res );
foreach ( $res as $row ) { foreach ( $res as $row ) {
$this->assertInstanceOf( EchoNotification::class, $row ); $this->assertInstanceOf( EchoNotification::class, $row );