diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2017-08-11 15:18:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2017-08-11 15:18:48 +0000 |
commit | b5ddc3a4b4d82023827681c1cc2771fc859ac01b (patch) | |
tree | 6fb449431bf371d9f9253cd770e19a665681ec7c | |
parent | bf61a7743194c6b3add03fa4f0413d5cc21e40b8 (diff) | |
parent | 43e8cd0579b8c6c67add6f12af9ded460c47e6e2 (diff) | |
download | mediawikicore-b5ddc3a4b4d82023827681c1cc2771fc859ac01b.tar.gz mediawikicore-b5ddc3a4b4d82023827681c1cc2771fc859ac01b.zip |
Merge "Make phpcs pass"
-rw-r--r-- | includes/OutputPage.php | 2 | ||||
-rw-r--r-- | includes/changes/ChangesList.php | 7 | ||||
-rw-r--r-- | includes/specialpage/RedirectSpecialPage.php | 2 | ||||
-rw-r--r-- | phpcs.xml | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/changes/EnhancedChangesListTest.php | 5 | ||||
-rw-r--r-- | tests/phpunit/includes/changes/OldChangesListTest.php | 12 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/libs/xmp/XMPTest.php | 2 | ||||
-rw-r--r-- | tests/phpunit/includes/specials/SpecialRecentchangesTest.php | 2 | ||||
-rw-r--r-- | tests/phpunit/mocks/MockWebRequest.php | 3 |
10 files changed, 22 insertions, 17 deletions
diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 7a2cf0070ed1..6aa11f6f8431 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2913,7 +2913,7 @@ class OutputPage extends ContextSource { // Use an IE conditional comment to serve the script only to old IE $pieces[] = '<!--[if lt IE 9]>' . Html::element( 'script', [ - 'src' => OutputPage::transformResourcePath( + 'src' => self::transformResourcePath( $this->getConfig(), "/resources/lib/html5shiv/html5shiv{$min}.js" ), diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 2182c6cb7eee..04f815a9fdfe 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -753,11 +753,12 @@ class ChangesList extends ContextSource { switch ( $type ) { case RecentChange::SRC_EDIT: case RecentChange::SRC_NEW: - $attrs[ 'data-mw-revid' ] = $rc->mAttribs['rc_this_oldid']; + $attrs['data-mw-revid'] = $rc->mAttribs['rc_this_oldid']; break; case RecentChange::SRC_LOG: - $attrs[ 'data-mw-logid' ] = $rc->mAttribs['rc_logid']; - $attrs[ 'data-mw-logaction' ] = $rc->mAttribs['rc_log_type'] . '/' . $rc->mAttribs['rc_log_action']; + $attrs['data-mw-logid'] = $rc->mAttribs['rc_logid']; + $attrs['data-mw-logaction'] = + $rc->mAttribs['rc_log_type'] . '/' . $rc->mAttribs['rc_log_action']; break; } diff --git a/includes/specialpage/RedirectSpecialPage.php b/includes/specialpage/RedirectSpecialPage.php index 4e5da9701b7a..d3e22a0f6205 100644 --- a/includes/specialpage/RedirectSpecialPage.php +++ b/includes/specialpage/RedirectSpecialPage.php @@ -105,7 +105,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { public function personallyIdentifiableTarget() { return false; } - + protected function showNoRedirectPage() { $class = static::class; throw new MWException( "RedirectSpecialPage $class doesn't redirect!" ); diff --git a/phpcs.xml b/phpcs.xml index d2e4fcc5f04e..3ea3048e1729 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,8 +2,6 @@ <ruleset name="MediaWiki"> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <exclude name="Generic.ControlStructures.InlineControlStructure" /> - <!-- Rule will pass in 0.10.0 but update depends on T167168 --> - <exclude name="MediaWiki.WhiteSpace.SpaceBeforeClassBrace.NoSpaceBeforeBrace" /> <!-- Disable rules added in 0.8.0 that don't pass yet --> <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" /> diff --git a/tests/phpunit/includes/changes/EnhancedChangesListTest.php b/tests/phpunit/includes/changes/EnhancedChangesListTest.php index 465bc22f60df..1290c641dfba 100644 --- a/tests/phpunit/includes/changes/EnhancedChangesListTest.php +++ b/tests/phpunit/includes/changes/EnhancedChangesListTest.php @@ -99,7 +99,10 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase { $enhancedChangesList->recentChangesLine( $recentChange, false ); $html = $enhancedChangesList->endRecentChangesList(); - $this->assertRegExp( '/data-mw-revid="5" data-mw-ts="20131103092153" class="[^"]*mw-enhanced-rc[^"]*"/', $html ); + $this->assertRegExp( + '/data-mw-revid="5" data-mw-ts="20131103092153" class="[^"]*mw-enhanced-rc[^"]*"/', + $html + ); $recentChange2 = $this->getEditChange( '20131103092253' ); $enhancedChangesList->recentChangesLine( $recentChange2, false ); diff --git a/tests/phpunit/includes/changes/OldChangesListTest.php b/tests/phpunit/includes/changes/OldChangesListTest.php index 90c60c826c83..244a05decd51 100644 --- a/tests/phpunit/includes/changes/OldChangesListTest.php +++ b/tests/phpunit/includes/changes/OldChangesListTest.php @@ -126,10 +126,14 @@ class OldChangesListTest extends MediaWikiLangTestCase { $oldChangesList = $this->getOldChangesList(); $line = $oldChangesList->recentChangesLine( $recentChange, false, 1 ); - $this->assertRegExp( '/<li data-mw-revid="\d+" data-mw-ts="\d+" class="[\w\s-]*mw-tag-vandalism[\w\s-]*">/', - $line ); - $this->assertRegExp( '/<li data-mw-revid="\d+" data-mw-ts="\d+" class="[\w\s-]*mw-tag-newbie[\w\s-]*">/', - $line ); + $this->assertRegExp( + '/<li data-mw-revid="\d+" data-mw-ts="\d+" class="[\w\s-]*mw-tag-vandalism[\w\s-]*">/', + $line + ); + $this->assertRegExp( + '/<li data-mw-revid="\d+" data-mw-ts="\d+" class="[\w\s-]*mw-tag-newbie[\w\s-]*">/', + $line + ); } public function testRecentChangesLine_numberOfWatchingUsers() { diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php index 3d405faf3df8..9c4c9be2f970 100644 --- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php +++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php @@ -2,7 +2,7 @@ use Wikimedia\TestingAccessWrapper; -class WANObjectCacheTest extends PHPUnit_Framework_TestCase { +class WANObjectCacheTest extends PHPUnit_Framework_TestCase { /** @var WANObjectCache */ private $cache; /**@var BagOStuff */ diff --git a/tests/phpunit/includes/libs/xmp/XMPTest.php b/tests/phpunit/includes/libs/xmp/XMPTest.php index 5eee8b88c9e2..514e6cdddc86 100644 --- a/tests/phpunit/includes/libs/xmp/XMPTest.php +++ b/tests/phpunit/includes/libs/xmp/XMPTest.php @@ -4,7 +4,7 @@ * @group Media * @covers XMPReader */ -class XMPTest extends PHPUnit_Framework_TestCase { +class XMPTest extends PHPUnit_Framework_TestCase { protected function setUp() { parent::setUp(); diff --git a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php index a9a612d51f14..0af308950157 100644 --- a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php +++ b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php @@ -27,7 +27,7 @@ class SpecialRecentchangesTest extends AbstractChangesListSpecialPageTestCase { [ 'days=3', [ 'days' => '3' ] ], - [ 'days=0.25', [ 'days' => '0.25'] ], + [ 'days=0.25', [ 'days' => '0.25' ] ], [ 'namespace=5', [ 'namespace' => '5' ] ], diff --git a/tests/phpunit/mocks/MockWebRequest.php b/tests/phpunit/mocks/MockWebRequest.php index 3ac5bfb06702..90475c384ad2 100644 --- a/tests/phpunit/mocks/MockWebRequest.php +++ b/tests/phpunit/mocks/MockWebRequest.php @@ -7,8 +7,7 @@ * WebRequest#response), then you might be able to use this mock to simplify * your tests. */ -class MockWebRequest extends WebRequest -{ +class MockWebRequest extends WebRequest { /** * @var WebResponse */ |