Thiemo Mättig (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/254415

Change subject: Split lines longer that 130 characters
......................................................................

Split lines longer that 130 characters

I'm not touching the phpcs.xml settings in this patch on purpose.
Reducing the hard line length limit should be done when all team members
agree. However, I still think this patch is usefull. This will make it
much, much easier to actually reduce the hard limit later.

Change-Id: I0cfed71515231d7ebd40472b9372a8b0c72662c7
---
M client/maintenance/updateSubscriptions.php
M purtle/tests/phpunit/N3QuoterTest.php
M repo/tests/phpunit/includes/ChangeDispatcherTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
M repo/tests/phpunit/includes/api/BotEditTest.php
M repo/tests/phpunit/includes/api/PermissionsTestCase.php
M repo/tests/phpunit/includes/api/SetClaimTest.php
M repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
8 files changed, 134 insertions(+), 58 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/15/254415/1

diff --git a/client/maintenance/updateSubscriptions.php 
b/client/maintenance/updateSubscriptions.php
index 6b7e7c0..8a072e7 100644
--- a/client/maintenance/updateSubscriptions.php
+++ b/client/maintenance/updateSubscriptions.php
@@ -17,7 +17,8 @@
 require_once $basePath . '/maintenance/Maintenance.php';
 
 /**
- * Maintenance script for inserting subscriptions into wb_changes_subscription 
based on the wbc_entity_usage table.
+ * Maintenance script for inserting subscriptions into wb_changes_subscription 
based on the
+ * wbc_entity_usage table.
  *
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
@@ -25,10 +26,12 @@
 class UpdateSubscriptions extends Maintenance {
 
        public function __construct() {
-               $this->mDescription = 'Updates the repo\'s 
wb_changes_subscription table based on entries in wbc_entity_usage.';
+               $this->mDescription = 'Updates the repo\'s 
wb_changes_subscription table based on entries'
+                       . ' in wbc_entity_usage.';
 
                $this->addOption( 'start-item', "The entity ID to start from.", 
false, true );
-               $this->addOption( 'purge', "Purge subscriptions first. If not 
given, subscriptions are only added, not removed.", false, false );
+               $this->addOption( 'purge', 'Purge subscriptions first. If not 
given, subscriptions are only'
+                       . ' added, not removed.', false, false );
 
                parent::__construct();
 
@@ -43,7 +46,8 @@
         */
        public function execute() {
                if ( !defined( 'WBC_VERSION' ) ) {
-                       $this->error( "You need to have WikibaseClient enabled 
in order to use this maintenance script!", 1 );
+                       $this->error( 'You need to have WikibaseClient enabled 
in order to use this maintenance'
+                               . ' script!', 1 );
                }
 
                $wikibaseClient = WikibaseClient::getDefaultInstance();
diff --git a/purtle/tests/phpunit/N3QuoterTest.php 
b/purtle/tests/phpunit/N3QuoterTest.php
index 2b8b7ed..1073e51 100644
--- a/purtle/tests/phpunit/N3QuoterTest.php
+++ b/purtle/tests/phpunit/N3QuoterTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikimedia\Purtle\Tests;
 
+use PHPUnit_Framework_TestCase;
 use Wikimedia\Purtle\N3Quoter;
 
 /**
@@ -12,15 +13,30 @@
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
  */
-class N3QuoterTest extends \PHPUnit_Framework_TestCase {
+class N3QuoterTest extends PHPUnit_Framework_TestCase {
 
        public function provideEscapeIRI() {
                return array(
-                       array( 'http://acme.com/test.php?x=y&foo=bar#part', 
'http://acme.com/test.php?x=y&foo=bar#part' ),
-                       array( 'http://acme.com/"evil stuff"', 
'http://acme.com/%22evil%20stuff%22' ),
-                       array( 'http://acme.com/<wacky stuff>', 
'http://acme.com/%3Cwacky%20stuff%3E' ),
-                       array( 'http://acme.com\\back\\slash', 
'http://acme.com%5Cback%5Cslash' ),
-                       array( 
'http://acme.com/~`!@#$%^&*()-_=+[]{}|:;\'",.<>/?', 
'http://acme.com/~%60!@#$%%5E&*()-_=+[]%7B%7D%7C:;\'%22,.%3C%3E/?' ),
+                       array(
+                               'http://acme.com/test.php?x=y&foo=bar#part',
+                               'http://acme.com/test.php?x=y&foo=bar#part'
+                       ),
+                       array(
+                               'http://acme.com/"evil stuff"',
+                               'http://acme.com/%22evil%20stuff%22'
+                       ),
+                       array(
+                               'http://acme.com/<wacky stuff>',
+                               'http://acme.com/%3Cwacky%20stuff%3E'
+                       ),
+                       array(
+                               'http://acme.com\\back\\slash',
+                               'http://acme.com%5Cback%5Cslash'
+                       ),
+                       array(
+                               
'http://acme.com/~`!@#$%^&*()-_=+[]{}|:;\'",.<>/?',
+                               
'http://acme.com/~%60!@#$%%5E&*()-_=+[]%7B%7D%7C:;\'%22,.%3C%3E/?'
+                       ),
                );
        }
 
diff --git a/repo/tests/phpunit/includes/ChangeDispatcherTest.php 
b/repo/tests/phpunit/includes/ChangeDispatcherTest.php
index 5cb779f..2301aee 100644
--- a/repo/tests/phpunit/includes/ChangeDispatcherTest.php
+++ b/repo/tests/phpunit/includes/ChangeDispatcherTest.php
@@ -275,7 +275,14 @@
        /**
         * @dataProvider provideGetPendingChanges
         */
-       public function testGetPendingChanges( $siteId, $afterId, $batchSize, 
$batchChunkFactor, array $expectedChanges, $expectedSeen ) {
+       public function testGetPendingChanges(
+               $siteId,
+               $afterId,
+               $batchSize,
+               $batchChunkFactor,
+               array $expectedChanges,
+               $expectedSeen
+       ) {
                $coordinator = $this->getMock( 
'Wikibase\Store\ChangeDispatchCoordinator' );
 
                $dispatcher = $this->getChangeDispatcher( $coordinator );
diff --git 
a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php 
b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
index d5858ef..503522f 100644
--- 
a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
+++ 
b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
@@ -186,8 +186,10 @@
                                array(), // incoming
                                null, // flavor
                                array( // output regex
-                                       'data about' => 
'!<http://data\.acme\.test/Q42> *<http://schema\.org/about> 
*<http://acme\.test/Q42> *\.!s',
-                                       'label' => '!<http://acme\.test/Q42> 
*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label42"@en *\.!s',
+                                       'data about' => 
'!<http://data\.acme\.test/Q42> *<http://schema\.org/about> '
+                                               . '*<http://acme\.test/Q42> 
*\.!s',
+                                       'label' => '!<http://acme\.test/Q42> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label42"@en *\.!s',
                                ),
                                array(),
                                'application/n-triples', // expected mime
@@ -200,24 +202,24 @@
                                array(), // incoming
                                'full', // flavor
                                array( // output regex
-                                       'data about' => 
'!<http://data\.acme\.test/Q42> *'
-                                               . '<http://schema\.org/about> *'
-                                               . '<http://acme\.test/Q42> 
*\.!s',
-                                       'label Q42' => 
'!<http://acme\.test/Q42> *'
-                                               . 
'<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label42"@en *\.!s',
-                                       'label Q23' => 
'!<http://acme\.test/Q23> *'
-                                               . 
'<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label23"@en *\.!s',
-                                       'label P5' => '!<http://acme\.test/P5> 
*'
-                                               . 
'<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label5"@en *\.!s',
-                                       'item-ref Q2233' => 
'!<http://acme\.test/statement/Q42-DEADBEEF> *'
-                                               . 
'<http://acme\.test/prop/statement/P5> *'
-                                               . '<http://acme\.test/Q2233> 
*\.!s',
-                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> *'
-                                               . 
'<http://www\.w3\.org/2002/07/owl#sameAs> *'
-                                               . '<http://acme\.test/Q23> 
*\.!s',
+                                       'data about' => 
'!<http://data\.acme\.test/Q42> *<http://schema\.org/about> '
+                                               . '*<http://acme\.test/Q42> 
*\.!s',
+                                       'label Q42' => 
'!<http://acme\.test/Q42> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label42"@en *\.!s',
+                                       'label Q23' => 
'!<http://acme\.test/Q23> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label23"@en *\.!s',
+                                       'label P5' => '!<http://acme\.test/P5> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label5"@en *\.!s',
+                                       'item-ref Q2233' => 
'!<http://acme\.test/statement/Q42-DEADBEEF> '
+                                               . 
'*<http://acme\.test/prop/statement/P5> *<http://acme\.test/Q2233> *\.!s',
+                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
                                ),
                                array(
-                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
+                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
                                ),
                                'application/n-triples', // expected mime
                        ),
@@ -229,10 +231,16 @@
                                array( $q2233, $q222333 ), // incoming
                                null, // flavor
                                array( // output regex
-                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> 
*<http://acme\.test/Q23> *\.!s',
-                                       'label Q23' => 
'!<http://acme\.test/Q23> *<http://www\.w3\.org/2000/01/rdf-schema#label> 
*"Label23"@en *\.!s',
-                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
-                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
+                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
+                                       'label Q23' => 
'!<http://acme\.test/Q23> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label23"@en *\.!s',
+                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
+                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
                                ),
                                array(),
                                'application/n-triples', // expected mime
@@ -245,12 +253,18 @@
                                array( $q2233, $q222333 ), // incoming
                                'dump', // flavor
                                array( // output regex
-                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
+                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
                                ),
                                array(
-                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> 
*<http://acme\.test/Q23> *\.!s',
-                                       'label Q23' => 
'!<http://acme\.test/Q23> *<http://www\.w3\.org/2000/01/rdf-schema#label> 
*"Label23"@en *\.!s',
-                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
+                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
+                                       'label Q23' => 
'!<http://acme\.test/Q23> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label23"@en *\.!s',
+                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
                                ),
                                'application/n-triples', // expected mime
                        ),
@@ -262,10 +276,16 @@
                                array( $q2233, $q222333 ), // incoming
                                null, // flavor
                                array( // output regex
-                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> 
*<http://acme\.test/Q23> *\.!s',
-                                       'label Q23' => 
'!<http://acme\.test/Q23> *<http://www\.w3\.org/2000/01/rdf-schema#label> 
*"Label23"@en *\.!s',
-                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
-                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
+                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
+                                       'label Q23' => 
'!<http://acme\.test/Q23> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label23"@en *\.!s',
+                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
+                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
                                ),
                                array(
                                ),
@@ -279,12 +299,18 @@
                                array( $q2233, $q222333 ), // incoming
                                'dump', // flavor
                                array( // output regex
-                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> 
*<http://acme\.test/Q23> *\.!s',
-                                       'label Q23' => 
'!<http://acme\.test/Q23> *<http://www\.w3\.org/2000/01/rdf-schema#label> 
*"Label23"@en *\.!s',
+                                       'data about' => 
'!<http://data\.acme\.test/Q23> *<http://schema\.org/about> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
+                                       'label Q23' => 
'!<http://acme\.test/Q23> '
+                                               . 
'*<http://www\.w3\.org/2000/01/rdf-schema#label> *"Label23"@en *\.!s',
                                ),
                                array(
-                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
-                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> *<http://www\.w3\.org/2002/07/owl#sameAs> 
*<http://acme\.test/Q23> *\.!s',
+                                       'redirect Q2233' => 
'!<http://acme\.test/Q2233> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
+                                       'redirect Q222333' => 
'!<http://acme\.test/Q222333> '
+                                               . 
'*<http://www\.w3\.org/2002/07/owl#sameAs> '
+                                               . '*<http://acme\.test/Q23> 
*\.!s',
                                ),
                                'application/n-triples', // expected mime
                        ),
@@ -305,7 +331,13 @@
                $expectedMimeType
        ) {
                $service = $this->newService();
-               list( $data, $mimeType ) = $service->getSerializedData( 
$format, $entityRev, $followedRedirect, $incomingRedirects, $flavor );
+               list( $data, $mimeType ) = $service->getSerializedData(
+                       $format,
+                       $entityRev,
+                       $followedRedirect,
+                       $incomingRedirects,
+                       $flavor
+               );
 
                $this->assertEquals( $expectedMimeType, $mimeType );
 
diff --git a/repo/tests/phpunit/includes/api/BotEditTest.php 
b/repo/tests/phpunit/includes/api/BotEditTest.php
index 386918d..3532fe0 100644
--- a/repo/tests/phpunit/includes/api/BotEditTest.php
+++ b/repo/tests/phpunit/includes/api/BotEditTest.php
@@ -42,7 +42,9 @@
                        '[email protected]',
                        array( 'bot' )
                );
-               $this->mergeMwGlobalArrayValue( 'wgGroupPermissions', array( 
'user' => array( 'item-merge' => true, 'item-redirect' => true ) ) );
+               $this->mergeMwGlobalArrayValue( 'wgGroupPermissions', array(
+                       'user' => array( 'item-merge' => true, 'item-redirect' 
=> true ),
+               ) );
 
                if ( !isset( self::$hasSetup ) ) {
                        $this->initTestEntities( array( 'Empty', 'Leipzig', 
'Osaka' ) );
diff --git a/repo/tests/phpunit/includes/api/PermissionsTestCase.php 
b/repo/tests/phpunit/includes/api/PermissionsTestCase.php
index 057083f..2ac61a7 100644
--- a/repo/tests/phpunit/includes/api/PermissionsTestCase.php
+++ b/repo/tests/phpunit/includes/api/PermissionsTestCase.php
@@ -46,7 +46,12 @@
                parent::tearDown();
        }
 
-       protected function doPermissionsTest( $action, array $params, array 
$permissions = null, $expectedError = null ) {
+       protected function doPermissionsTest(
+               $action,
+               array $params,
+               array $permissions = null,
+               $expectedError = null
+       ) {
                global $wgUser, $wgGroupPermissions;
 
                $this->setMwGlobals( 'wgUser', clone $wgUser );
@@ -65,7 +70,8 @@
                        }
                } catch ( UsageException $ex ) {
                        if ( $expectedError !== true ) {
-                               $this->assertEquals( $expectedError, 
$ex->getCodeString(), 'API did not return expected error code. Got error 
message ' . $ex );
+                               $this->assertEquals( $expectedError, 
$ex->getCodeString(),
+                                       'API did not return expected error 
code. Got error message ' . $ex );
                        }
                }
        }
diff --git a/repo/tests/phpunit/includes/api/SetClaimTest.php 
b/repo/tests/phpunit/includes/api/SetClaimTest.php
index 722fca4..e65ab31 100644
--- a/repo/tests/phpunit/includes/api/SetClaimTest.php
+++ b/repo/tests/phpunit/includes/api/SetClaimTest.php
@@ -359,7 +359,8 @@
                $this->assertArrayHasKey( 'claim', $resultArray, 'top level 
element has a statement key' );
 
                if ( isset( $resultArray['claim']['qualifiers'] ) ) {
-                       $this->assertArrayHasKey( 'qualifiers-order', 
$resultArray['claim'], '"qualifiers-order" key is set when returning 
qualifiers' );
+                       $this->assertArrayHasKey( 'qualifiers-order', 
$resultArray['claim'],
+                               '"qualifiers-order" key is set when returning 
qualifiers' );
                }
        }
 
diff --git a/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php 
b/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
index 0f48441..dbdae74 100644
--- a/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
@@ -5,8 +5,8 @@
 use FauxResponse;
 use Site;
 use SiteStore;
-use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\EntityIdParser;
+use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Services\Lookup\EntityLookup;
 use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup;
 use Wikibase\Lib\Store\SiteLinkLookup;
@@ -133,13 +133,21 @@
        }
 
        public function requestWithoutRedirectProvider() {
-               $cases = array();
-               $cases['empty'] = array( '', null, '', '', '' );
-               $cases['invalidItemID'] = array( 'enwiki/invalid', null, 
'enwiki', 'invalid', '(wikibase-gotolinkedpage-error-item-id-invalid)' );
-               $cases['notFound'] = array( 'enwiki/Q42', null, 'enwiki', 
'Q42', '(wikibase-gotolinkedpage-error-item-not-found)' );
-               $cases['notFound2'] = array( 'XXwiki/Q23', null, 'XXwiki', 
'Q23', '(wikibase-gotolinkedpage-error-page-not-found)' );
-
-               return $cases;
+               return array(
+                       'empty' => array( '', null, '', '', '' ),
+                       'invalidItemID' => array(
+                               'enwiki/invalid', null, 'enwiki', 'invalid',
+                               
'(wikibase-gotolinkedpage-error-item-id-invalid)'
+                       ),
+                       'notFound' => array(
+                               'enwiki/Q42', null, 'enwiki', 'Q42',
+                               '(wikibase-gotolinkedpage-error-item-not-found)'
+                       ),
+                       'notFound2' => array(
+                               'XXwiki/Q23', null, 'XXwiki', 'Q23',
+                               '(wikibase-gotolinkedpage-error-page-not-found)'
+                       ),
+               );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/254415
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0cfed71515231d7ebd40472b9372a8b0c72662c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to