Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249776
Change subject: build: Enable phpcs rule
'PSR2.Methods.MethodDeclaration.StaticBeforeVisibility' and make pass
......................................................................
build: Enable phpcs rule
'PSR2.Methods.MethodDeclaration.StaticBeforeVisibility' and make pass
Change-Id: Iff0709c3a30f8c39d54bab2361e109c96aea6aa0
---
M includes/DiffParser.php
M includes/DiscussionParser.php
M phpcs.xml
M tests/phpunit/BatchRowUpdateTest.php
M tests/phpunit/DiffParserTest.php
M tests/phpunit/DiscussionParserTest.php
6 files changed, 12 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/76/249776/1
diff --git a/includes/DiffParser.php b/includes/DiffParser.php
index a6ee617..f7ae626 100644
--- a/includes/DiffParser.php
+++ b/includes/DiffParser.php
@@ -88,7 +88,7 @@
* Duplicates the check from the global wfDiff function to determine
* if we are using internal or external diff utilities
*/
- static protected function usingInternalDiff() {
+ protected static function usingInternalDiff() {
global $wgDiff;
wfSuppressWarnings();
diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php
index 0ac66b5..ececc02 100644
--- a/includes/DiscussionParser.php
+++ b/includes/DiscussionParser.php
@@ -596,7 +596,7 @@
* and contribution pages
* @return array Array of users; empty array for none detected
*/
- static public function extractUsersFromLine( $line ) {
+ public static function extractUsersFromLine( $line ) {
/*
* Signatures can look like anything (as defined by i18n
messages
* "signature" & "signature-anon").
@@ -649,7 +649,7 @@
* - First element is the position of the signature.
* - Second element is the normalised user name.
*/
- static public function getUserFromLine( $line, Title $title = null ) {
+ public static function getUserFromLine( $line, Title $title = null ) {
global $wgParser;
/*
diff --git a/phpcs.xml b/phpcs.xml
index 11a5228..585dc29 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -8,7 +8,6 @@
<exclude
name="MediaWiki.WhiteSpace.SpaceAfterControlStructure.Incorrect"/>
<exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing"/>
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed"/>
- <exclude
name="PSR2.Methods.MethodDeclaration.StaticBeforeVisibility"/>
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
</rule>
<arg name="encoding" value="utf8"/>
diff --git a/tests/phpunit/BatchRowUpdateTest.php
b/tests/phpunit/BatchRowUpdateTest.php
index fe43c9b..ecb2360 100644
--- a/tests/phpunit/BatchRowUpdateTest.php
+++ b/tests/phpunit/BatchRowUpdateTest.php
@@ -24,7 +24,7 @@
$writer->write( $updates );
}
- static protected function mockUpdate( array $changes ) {
+ protected static function mockUpdate( array $changes ) {
static $i = 0;
return array(
@@ -56,7 +56,7 @@
$this->assertEquals( count( $response ) - 1, $pos );
}
- static public function provider_readerGetPrimaryKey() {
+ public static function provider_readerGetPrimaryKey() {
$row = array(
'id_field' => 42,
'some_col' => 'dvorak',
@@ -88,7 +88,7 @@
$this->assertEquals( $expected, $reader->extractPrimaryKeys(
(object)$row ), $message );
}
- static public function provider_readerSetFetchColumns() {
+ public static function provider_readerSetFetchColumns() {
return array(
array(
@@ -140,7 +140,7 @@
$reader->rewind();
}
- static public function provider_readerSelectConditions() {
+ public static function provider_readerSelectConditions() {
return array(
array(
diff --git a/tests/phpunit/DiffParserTest.php b/tests/phpunit/DiffParserTest.php
index e5bfc9b..c8f2841 100644
--- a/tests/phpunit/DiffParserTest.php
+++ b/tests/phpunit/DiffParserTest.php
@@ -14,7 +14,7 @@
$this->assertEquals( $expect, $changeSet, $message );
}
- static public function provider_getChangeSet() {
+ public static function provider_getChangeSet() {
return array(
array(
@@ -163,7 +163,7 @@
);
}
- static protected function mockAction( $action, $content, $left, $right
= null ) {
+ protected static function mockAction( $action, $content, $left, $right
= null ) {
if ( $right === null ) {
$right = $left;
}
@@ -176,7 +176,7 @@
);
}
- static public function mockChange( $oldContent, $newContent, $left,
$right = null ) {
+ public static function mockChange( $oldContent, $newContent, $left,
$right = null ) {
if ( $right === null ) {
$right = $left;
}
diff --git a/tests/phpunit/DiscussionParserTest.php
b/tests/phpunit/DiscussionParserTest.php
index 05de7c7..4d69639 100644
--- a/tests/phpunit/DiscussionParserTest.php
+++ b/tests/phpunit/DiscussionParserTest.php
@@ -920,7 +920,7 @@
return $exemplarTimestamp;
}
- static public function provider_detectSectionTitleAndText() {
+ public static function provider_detectSectionTitleAndText() {
$name = 'Werdna'; // See EchoDiscussionParserTest::$testusers
$comment = self::signedMessage( $name );
@@ -1046,7 +1046,7 @@
return 'foo';
}
- static public function provider_getFullSection() {
+ public static function provider_getFullSection() {
$tests = array(
array(
'Extracts full section',
--
To view, visit https://gerrit.wikimedia.org/r/249776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff0709c3a30f8c39d54bab2361e109c96aea6aa0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits