jenkins-bot has submitted this change and it was merged.

Change subject: Fix PHPCS spacey issues
......................................................................


Fix PHPCS spacey issues

Change-Id: I5dcb7777c256dfd0891365150cc33a4cb3737d41
---
M client/includes/DataAccess/Scribunto/EntityAccessor.php
M client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php
M client/includes/Hooks/SpecialWatchlistQueryHandler.php
M client/includes/Hooks/UpdateRepoHookHandlers.php
M client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
M client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
M 
client/tests/phpunit/includes/DataAccess/PropertyParserFunction/VariantsAwareRendererTest.php
M client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
M 
client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php
M client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php
M client/tests/phpunit/includes/SiteLinkCommentCreatorTest.php
M client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
M client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php
M client/tests/phpunit/includes/recentchanges/ExternalChangeFactoryTest.php
M client/tests/phpunit/includes/specials/SpecialUnconnectedPagesTest.php
M 
client/tests/phpunit/includes/store/sql/ConsistentReadConnectionManagerTest.php
M lib/WikibaseLib.hooks.php
M lib/WikibaseLib.php
M lib/tests/phpunit/changes/ChangeRowTest.php
M lib/tests/phpunit/formatters/MwTimeIsoFormatterTest.php
M lib/tests/phpunit/sites/SiteMatrixParserTest.php
M lib/tests/phpunit/sites/SitesBuilderTest.php
M lib/tests/phpunit/specials/SpecialPageTestBase.php
M lib/tests/phpunit/store/ChunkCacheTest.php
M lib/tests/phpunit/store/MockChunkAccess.php
M lib/tests/phpunit/store/MockTermIndex.php
M lib/tests/phpunit/store/Sql/SiteLinkTableTest.php
M lib/tests/phpunit/store/TermIndexTest.php
M purtle/src/N3RdfWriterBase.php
M purtle/src/RdfWriterBase.php
M purtle/src/TurtleRdfWriter.php
M purtle/src/UnicodeEscaper.php
M purtle/src/XmlRdfWriter.php
M repo/Wikibase.hooks.php
M repo/Wikibase.php
M repo/includes/ChangeOp/ChangeOpQualifierRemove.php
M repo/includes/ChangeOp/ChangeOpReference.php
M repo/includes/ChangePruner.php
M repo/includes/Diff/ClaimDiffer.php
M repo/includes/Dumpers/RdfDumpGenerator.php
M repo/includes/EntityParserOutputGenerator.php
M repo/includes/Hooks/EditFilterHookRunner.php
M repo/includes/WikibaseRepo.php
M repo/includes/actions/EditEntityAction.php
M repo/includes/actions/ViewEntityAction.php
M repo/includes/api/GetEntities.php
M repo/includes/api/SetReference.php
M repo/includes/content/EntityContentFactory.php
M repo/includes/content/EntityHandler.php
M repo/includes/rdf/DateTimeValueCleaner.php
M repo/includes/rdf/FullStatementRdfBuilder.php
M repo/includes/rdf/JulianDateTimeValueCleaner.php
M repo/includes/rdf/RdfBuilder.php
M repo/includes/store/sql/ChangesSubscriptionTableBuilder.php
M repo/includes/store/sql/EntityPerPageTable.php
M repo/includes/store/sql/PropertyInfoTableBuilder.php
M repo/includes/store/sql/SqlChangeDispatchCoordinator.php
M repo/includes/store/sql/TermSearchKeyBuilder.php
M repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
M repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
M repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteJobTest.php
M repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveJobTest.php
M repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
M repo/tests/phpunit/includes/actions/EditEntityActionTest.php
M repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
M repo/tests/phpunit/includes/content/EntityContentTest.php
M repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutPageTest.php
M repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
M repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
M repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
M repo/tests/phpunit/includes/specials/SpecialMergeItemsTest.php
M repo/tests/phpunit/includes/specials/SpecialModifyTermTestCase.php
M repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
M repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
M repo/tests/phpunit/includes/specials/SpecialRedirectEntityTest.php
M repo/tests/phpunit/includes/specials/SpecialSetLabelDescriptionAliasesTest.php
M repo/tests/phpunit/includes/specials/SpecialSetSiteLinkTest.php
M repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
M repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
M repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
M repo/tests/phpunit/includes/store/sql/WikiPageEntityMetaDataLookupTest.php
M repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
M view/src/EntityTermsView.php
M view/src/SnakHtmlGenerator.php
M view/src/StatementGroupListView.php
M view/tests/phpunit/ItemViewTest.php
M view/tests/phpunit/Template/TemplateRegistryTest.php
88 files changed, 205 insertions(+), 195 deletions(-)

Approvals:
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/client/includes/DataAccess/Scribunto/EntityAccessor.php 
b/client/includes/DataAccess/Scribunto/EntityAccessor.php
index f206d18..95d0ac2 100644
--- a/client/includes/DataAccess/Scribunto/EntityAccessor.php
+++ b/client/includes/DataAccess/Scribunto/EntityAccessor.php
@@ -100,7 +100,7 @@
         * @param array &$entityArr
         */
        private function renumber( array &$entityArr ) {
-               foreach( $entityArr as &$value ) {
+               foreach ( $entityArr as &$value ) {
                        if ( !is_array( $value ) ) {
                                continue;
                        }
diff --git a/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php 
b/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php
index 489f002..3420434 100644
--- a/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php
+++ b/client/includes/DataAccess/Scribunto/WikibaseLuaBindings.php
@@ -139,7 +139,7 @@
        public function getLabel( $prefixedEntityId ) {
                try {
                        $entityId = $this->entityIdParser->parse( 
$prefixedEntityId );
-               } catch( EntityIdParsingException $e ) {
+               } catch ( EntityIdParsingException $e ) {
                        return null;
                }
 
@@ -164,7 +164,7 @@
        public function getDescription( $prefixedEntityId ) {
                try {
                        $entityId = $this->entityIdParser->parse( 
$prefixedEntityId );
-               } catch( EntityIdParsingException $e ) {
+               } catch ( EntityIdParsingException $e ) {
                        return null;
                }
 
@@ -191,7 +191,7 @@
        public function getSiteLinkPageName( $prefixedEntityId ) {
                try {
                        $itemId = new ItemId( $prefixedEntityId );
-               } catch( InvalidArgumentException $e ) {
+               } catch ( InvalidArgumentException $e ) {
                        return null;
                }
 
diff --git a/client/includes/Hooks/SpecialWatchlistQueryHandler.php 
b/client/includes/Hooks/SpecialWatchlistQueryHandler.php
index 734f672..77337e1 100644
--- a/client/includes/Hooks/SpecialWatchlistQueryHandler.php
+++ b/client/includes/Hooks/SpecialWatchlistQueryHandler.php
@@ -102,7 +102,7 @@
        private function makeShowWikibaseConds( array $conds ) {
                $newConds = array();
 
-               foreach( $conds as $key => $cond ) {
+               foreach ( $conds as $key => $cond ) {
                        if ( $this->isRcTypeLogCondition( $cond ) ) {
                                $newConds[$key] = 
$this->makeShowLogAndWikibaseType();
                        } else {
diff --git a/client/includes/Hooks/UpdateRepoHookHandlers.php 
b/client/includes/Hooks/UpdateRepoHookHandlers.php
index 53dcc5c..19570b3 100644
--- a/client/includes/Hooks/UpdateRepoHookHandlers.php
+++ b/client/includes/Hooks/UpdateRepoHookHandlers.php
@@ -225,7 +225,7 @@
 
                        // To be able to find out about this in the 
ArticleDeleteAfter hook
                        $title->wikibasePushedDeleteToRepo = true;
-               } catch( MWException $e ) {
+               } catch ( MWException $e ) {
                        // This is not a reason to let an exception bubble up, 
we just
                        // show a message to the user that the Wikibase item 
needs to be
                        // manually updated.
@@ -270,7 +270,7 @@
 
                        // To be able to find out about this in the 
SpecialMovepageAfterMove hook
                        $newTitle->wikibasePushedMoveToRepo = true;
-               } catch( MWException $e ) {
+               } catch ( MWException $e ) {
                        // This is not a reason to let an exception bubble up, 
we just
                        // show a message to the user that the Wikibase item 
needs to be
                        // manually updated.
diff --git a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php 
b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
index cdb7f46..34b8033 100644
--- a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
+++ b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
@@ -487,7 +487,7 @@
        private function getItemWithSiteLinks( ItemId $id, array $links, array 
$badges = array() ) {
                $item = new Item( $id );
 
-               foreach( $links as $siteId => $page ) {
+               foreach ( $links as $siteId => $page ) {
                        $item->getSiteLinkList()->addNewSiteLink( $siteId, 
$page, $badges );
                }
 
diff --git a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php 
b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
index 734f424..b3e9229 100644
--- a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
+++ b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
@@ -200,11 +200,11 @@
                // merged change consisting of $create and $update
                $create_update = $this->makeChange( array(
                        'id' => null,
-                       'type' => $create->getField('type'), // because the 
first change has no parent
-                       'time' => $update->getField('time'), // last change's 
timestamp
-                       'object_id' => $update->getField('object_id'),
-                       'revision_id' => $update->getField('revision_id'), // 
last changes rev id
-                       'user_id' => $update->getField('user_id'),
+                       'type' => $create->getField( 'type' ), // because the 
first change has no parent
+                       'time' => $update->getField( 'time' ), // last change's 
timestamp
+                       'object_id' => $update->getField( 'object_id' ),
+                       'revision_id' => $update->getField( 'revision_id' ), // 
last changes rev id
+                       'user_id' => $update->getField( 'user_id' ),
                        'info' => array(
                                'metadata' => array(
                                        'bot' => 0,
@@ -237,11 +237,11 @@
                // merged change consisting of $create, $update and $updateXLink
                $create_update_link = $this->makeChange( array(
                        'id' => null,
-                       'type' => $create->getField('type'), // because the 
first change has no parent
-                       'time' => $updateXLink->getField('time'), // last 
change's timestamp
-                       'object_id' => $updateXLink->getField('object_id'),
-                       'revision_id' => $updateXLink->getField('revision_id'), 
// last changes rev id
-                       'user_id' => $updateXLink->getField('user_id'),
+                       'type' => $create->getField( 'type' ), // because the 
first change has no parent
+                       'time' => $updateXLink->getField( 'time' ), // last 
change's timestamp
+                       'object_id' => $updateXLink->getField( 'object_id' ),
+                       'revision_id' => $updateXLink->getField( 'revision_id' 
), // last changes rev id
+                       'user_id' => $updateXLink->getField( 'user_id' ),
                        'info' => array(
                                'metadata' => array(
                                        'bot' => 0,
diff --git 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/VariantsAwareRendererTest.php
 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/VariantsAwareRendererTest.php
index c2eed75..0be356b 100644
--- 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/VariantsAwareRendererTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/VariantsAwareRendererTest.php
@@ -39,7 +39,7 @@
 
                $languageRenderers = array();
 
-               foreach( $variants as $variant ) {
+               foreach ( $variants as $variant ) {
                        $languageRenderers[$variant] = $languageRenderer;
                }
 
diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php 
b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
index cb6360a..bde8949 100644
--- a/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
+++ b/client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
@@ -99,7 +99,7 @@
 
                $entityAccessor->getEntity( $itemId->getSerialization() );
                $this->assertTrue(
-                       $this->hasUsage($usages->getUsages(), $item->getId(), 
EntityUsage::ALL_USAGE ), 'all usage'
+                       $this->hasUsage( $usages->getUsages(), $item->getId(), 
EntityUsage::ALL_USAGE ), 'all usage'
                );
        }
 
@@ -130,7 +130,7 @@
        /**
         * @dataProvider provideZeroIndexedArray
         */
-       public function testZeroIndexArray ( array $array, array $expected ) {
+       public function testZeroIndexArray( array $array, array $expected ) {
                $renumber = new ReflectionMethod( 
'Wikibase\Client\DataAccess\Scribunto\EntityAccessor', 'renumber' );
                $renumber->setAccessible( true );
                $renumber->invokeArgs( $this->getEntityAccessor(), array( 
&$array ) );
diff --git 
a/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php
 
b/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php
index c0f6a93..0dfc713 100644
--- 
a/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php
+++ 
b/client/tests/phpunit/includes/DataAccess/WikibaseDataAccessTestItemSetUpHelper.php
@@ -64,15 +64,15 @@
 
                $qualifierSnak1 = $this->getTestSnak(
                        new PropertyId( 'P342' ),
-                       new StringValue( 'A qualifier Snak')
+                       new StringValue( 'A qualifier Snak' )
                );
                $qualifierSnak2 = $this->getTestSnak(
                        new PropertyId( 'P342' ),
-                       new StringValue( 'Moar qualifiers')
+                       new StringValue( 'Moar qualifiers' )
                );
                $referenceSnak = $this->getTestSnak(
                        new PropertyId( 'P342' ),
-                       new StringValue( 'A reference')
+                       new StringValue( 'A reference' )
                );
 
                $statement1->setQualifiers(
diff --git 
a/client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php 
b/client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php
index 3d33583..9714f65 100644
--- a/client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php
+++ b/client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php
@@ -102,7 +102,7 @@
        /**
         * @return SiteLinkLookup
         */
-       private function getSiteLinkLookup( ) {
+       private function getSiteLinkLookup() {
                $Q123 = new ItemId( 'Q123' );
 
                $lookup = $this->getMock( 'Wikibase\Lib\Store\SiteLinkLookup' );
diff --git a/client/tests/phpunit/includes/SiteLinkCommentCreatorTest.php 
b/client/tests/phpunit/includes/SiteLinkCommentCreatorTest.php
index d98c42d..ece60fc 100644
--- a/client/tests/phpunit/includes/SiteLinkCommentCreatorTest.php
+++ b/client/tests/phpunit/includes/SiteLinkCommentCreatorTest.php
@@ -38,7 +38,7 @@
 
                $updates = $this->getUpdates();
 
-               foreach( $updates as $update ) {
+               foreach ( $updates as $update ) {
                        $changes[] = array(
                                $update[0],
                                ItemChange::UPDATE,
diff --git a/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php 
b/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
index 95289e3..27846fb 100644
--- a/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
@@ -54,7 +54,7 @@
                );
 
                $this->trackerTester = new UsageTrackerContractTester( 
$this->sqlUsageTracker, array( $this, 'getUsages' ) );
-               $this->lookupTester = new UsageLookupContractTester( 
$this->sqlUsageTracker, array( $this, 'putUsages' )  );
+               $this->lookupTester = new UsageLookupContractTester( 
$this->sqlUsageTracker, array( $this, 'putUsages' ) );
        }
 
        public function getUsages( $pageId, $timestamp ) {
diff --git 
a/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php 
b/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php
index cbe512b..084abe3 100644
--- a/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php
+++ b/client/tests/phpunit/includes/recentchanges/ChangeLineFormatterTest.php
@@ -73,11 +73,11 @@
                        $changesList->recentChangesFlags( array( 
'wikibase-edit' => true ), '' )
                );
 
-               foreach( $expectedTags as $key => $tag ) {
+               foreach ( $expectedTags as $key => $tag ) {
                        $this->assertTag( $tag, $formattedLine, $key );
                }
 
-               foreach( $patterns as $pattern ) {
+               foreach ( $patterns as $pattern ) {
                        $this->assertRegExp( $pattern, $formattedLine );
                }
        }
diff --git 
a/client/tests/phpunit/includes/recentchanges/ExternalChangeFactoryTest.php 
b/client/tests/phpunit/includes/recentchanges/ExternalChangeFactoryTest.php
index a2d8f73..9912e3f 100644
--- a/client/tests/phpunit/includes/recentchanges/ExternalChangeFactoryTest.php
+++ b/client/tests/phpunit/includes/recentchanges/ExternalChangeFactoryTest.php
@@ -32,7 +32,7 @@
        }
 
        public function newFromRecentChangeProvider() {
-               $rev = new RevisionData ( 'Cat', 5, 92, 90, '20130819111741',
+               $rev = new RevisionData( 'Cat', 5, 92, 90, '20130819111741',
                        array( 'key' => 'wikibase-comment-update' ), 'testrepo'
                );
 
diff --git 
a/client/tests/phpunit/includes/specials/SpecialUnconnectedPagesTest.php 
b/client/tests/phpunit/includes/specials/SpecialUnconnectedPagesTest.php
index e88a909..781caf8 100644
--- a/client/tests/phpunit/includes/specials/SpecialUnconnectedPagesTest.php
+++ b/client/tests/phpunit/includes/specials/SpecialUnconnectedPagesTest.php
@@ -60,7 +60,7 @@
         */
        public function testBuildConditionals( $text, $expected ) {
                $page = $this->newSpecialPage();
-               $title = Title::newFromText( $text);
+               $title = Title::newFromText( $text );
                $checker = new NamespaceChecker( array( 2, 4 ), array( 0 ) );
                $dbr = wfGetDB( DB_SLAVE );
                $this->assertEquals( $expected, $page->buildConditionals( $dbr, 
$title, $checker ) );
diff --git 
a/client/tests/phpunit/includes/store/sql/ConsistentReadConnectionManagerTest.php
 
b/client/tests/phpunit/includes/store/sql/ConsistentReadConnectionManagerTest.php
index 23050e7..2070700 100644
--- 
a/client/tests/phpunit/includes/store/sql/ConsistentReadConnectionManagerTest.php
+++ 
b/client/tests/phpunit/includes/store/sql/ConsistentReadConnectionManagerTest.php
@@ -76,7 +76,7 @@
 
        public function testBeginAtomicSection() {
                $connection = $this->getConnectionMock();
-               $lb = $this->getLoadBalancerMock( );
+               $lb = $this->getLoadBalancerMock();
 
                $lb->expects( $this->exactly( 2 ) )
                        ->method( 'getConnection' )
@@ -97,7 +97,7 @@
 
        public function testCommitAtomicSection() {
                $connection = $this->getConnectionMock();
-               $lb = $this->getLoadBalancerMock( );
+               $lb = $this->getLoadBalancerMock();
 
                $lb->expects( $this->once() )
                        ->method( 'reuseConnection' )
@@ -114,7 +114,7 @@
 
        public function testRollbackAtomicSection() {
                $connection = $this->getConnectionMock();
-               $lb = $this->getLoadBalancerMock( );
+               $lb = $this->getLoadBalancerMock();
 
                $lb->expects( $this->once() )
                        ->method( 'reuseConnection' )
diff --git a/lib/WikibaseLib.hooks.php b/lib/WikibaseLib.hooks.php
index 674332a..784386e 100644
--- a/lib/WikibaseLib.hooks.php
+++ b/lib/WikibaseLib.hooks.php
@@ -2,6 +2,8 @@
 
 namespace Wikibase;
 
+use ResourceLoader;
+
 /**
  * File defining the hook handlers for the WikibaseLib extension.
  *
@@ -36,11 +38,11 @@
         * @since 0.2 (in repo as RepoHooks::onResourceLoaderTestModules in 0.1)
         *
         * @param array &$testModules
-        * @param \ResourceLoader &$resourceLoader
+        * @param ResourceLoader &$resourceLoader
         *
         * @return boolean
         */
-       public static function registerQUnitTests( array &$testModules, 
\ResourceLoader &$resourceLoader ) {
+       public static function registerQUnitTests( array &$testModules, 
ResourceLoader &$resourceLoader ) {
                $testModules['qunit'] = array_merge(
                        $testModules['qunit'],
                        include __DIR__ . '/tests/qunit/resources.php'
diff --git a/lib/WikibaseLib.php b/lib/WikibaseLib.php
index c0cd8d2..6241784 100644
--- a/lib/WikibaseLib.php
+++ b/lib/WikibaseLib.php
@@ -34,7 +34,8 @@
        die( 'Not an entry point.' );
 }
 
-if ( version_compare( $GLOBALS['wgVersion'], '1.20c', '<' ) ) { // Needs to be 
1.20c because version_compare() works in confusing ways.
+// Needs to be 1.20c because version_compare() works in confusing ways.
+if ( version_compare( $GLOBALS['wgVersion'], '1.20c', '<' ) ) {
        die( '<b>Error:</b> WikibaseLib requires MediaWiki 1.20 or above.' );
 }
 
@@ -105,4 +106,3 @@
                include_once __DIR__ . '/config/WikibaseLib.experimental.php';
        }
 } );
-
diff --git a/lib/tests/phpunit/changes/ChangeRowTest.php 
b/lib/tests/phpunit/changes/ChangeRowTest.php
index f6a6867..31d9eac 100644
--- a/lib/tests/phpunit/changes/ChangeRowTest.php
+++ b/lib/tests/phpunit/changes/ChangeRowTest.php
@@ -148,7 +148,7 @@
                );
        }
 
-       public function testGetObjectId( ) {
+       public function testGetObjectId() {
                $data = array( 'object_id' => 'p100' );
                $change = $this->getRowInstance( $data, true );
 
diff --git a/lib/tests/phpunit/formatters/MwTimeIsoFormatterTest.php 
b/lib/tests/phpunit/formatters/MwTimeIsoFormatterTest.php
index 458cd39..e23bb28 100644
--- a/lib/tests/phpunit/formatters/MwTimeIsoFormatterTest.php
+++ b/lib/tests/phpunit/formatters/MwTimeIsoFormatterTest.php
@@ -553,7 +553,7 @@
                $formatter = new MwTimeIsoFormatter( $options );
                $actual = $formatter->format( $timeValue );
 
-               $this->assertEquals( $expected, $actual, 'Testing ' . 
$timeValue->getTime() . ', precision ' . $timeValue->getPrecision()  );
+               $this->assertEquals( $expected, $actual, 'Testing ' . 
$timeValue->getTime() . ', precision ' . $timeValue->getPrecision() );
                if ( $roundtrip ) {
                        $this->assertCanRoundTrip( $actual, $timeValue, 
$languageCode );
                }
diff --git a/lib/tests/phpunit/sites/SiteMatrixParserTest.php 
b/lib/tests/phpunit/sites/SiteMatrixParserTest.php
index 9aaab29..bbcf2e5 100644
--- a/lib/tests/phpunit/sites/SiteMatrixParserTest.php
+++ b/lib/tests/phpunit/sites/SiteMatrixParserTest.php
@@ -188,7 +188,7 @@
        public function getSites( array $sitesData, $scriptPath, $articlePath, 
$protocol = '' ) {
                $sites = array();
 
-               foreach( $sitesData as $siteData ) {
+               foreach ( $sitesData as $siteData ) {
                        $fields = array(
                                'globalid' => $siteData['siteid'],
                                'type' => 'mediawiki',
diff --git a/lib/tests/phpunit/sites/SitesBuilderTest.php 
b/lib/tests/phpunit/sites/SitesBuilderTest.php
index 36f0ac6..005f954 100644
--- a/lib/tests/phpunit/sites/SitesBuilderTest.php
+++ b/lib/tests/phpunit/sites/SitesBuilderTest.php
@@ -34,7 +34,7 @@
                $sites = $this->getSites( $sitesData );
                $expectedSites = $sites;
 
-               foreach( $expectedSites as $site ) {
+               foreach ( $expectedSites as $site ) {
                        if ( $site->getGroup() === 'wikipedia' ) {
                                $site->addInterwikiId( $site->getLanguageCode() 
);
                                $site->addNavigationId( 
$site->getLanguageCode() );
@@ -51,7 +51,7 @@
 
                $expectedSites2 = $sites;
 
-               foreach( $expectedSites2 as $site ) {
+               foreach ( $expectedSites2 as $site ) {
                        if ( $site->getGroup() === 'wikivoyage' ) {
                                $site->addInterwikiId( $site->getLanguageCode() 
);
                                $site->addNavigationId( 
$site->getLanguageCode() );
@@ -126,7 +126,7 @@
        protected function getSites( array $sitesData ) {
                $sites = array();
 
-               foreach( $sitesData as $siteData ) {
+               foreach ( $sitesData as $siteData ) {
                        $fields = array(
                                'globalid' => $siteData['siteid'],
                                'type' => 'mediawiki',
diff --git a/lib/tests/phpunit/specials/SpecialPageTestBase.php 
b/lib/tests/phpunit/specials/SpecialPageTestBase.php
index 82acb63..e239ebd 100644
--- a/lib/tests/phpunit/specials/SpecialPageTestBase.php
+++ b/lib/tests/phpunit/specials/SpecialPageTestBase.php
@@ -44,7 +44,7 @@
                }
 
                if ( $obLevel !== $this->obLevel ) {
-                       $this->fail( "Test changed output buffer level: was 
{$this->obLevel} before test, but $obLevel after test.");
+                       $this->fail( "Test changed output buffer level: was 
{$this->obLevel} before test, but $obLevel after test." );
                }
 
                parent::tearDown();
diff --git a/lib/tests/phpunit/store/ChunkCacheTest.php 
b/lib/tests/phpunit/store/ChunkCacheTest.php
index e0e4df3..b08d47d 100644
--- a/lib/tests/phpunit/store/ChunkCacheTest.php
+++ b/lib/tests/phpunit/store/ChunkCacheTest.php
@@ -45,7 +45,7 @@
                                10,  // chunkSize
                                50, // maxSize
                                array(
-                                       self::makeCacheAction(  0, 4, 'start at 
the start' ),
+                                       self::makeCacheAction( 0, 4, 'start at 
the start' ),
                                        self::makeCacheAction( 10, 4, 'start at 
ten' ),
                                        self::makeCacheAction( 98, 5, 'exceed 
end' ),
                                )
@@ -63,7 +63,7 @@
                                        self::makeCacheAction( 14, 4, 'overlap 
block before' ),
                                        self::makeCacheAction( 26, 4, 'overlap 
block after' ),
 
-                                       self::makeCacheAction(  7, 4, 'detached 
block before' ),
+                                       self::makeCacheAction( 7, 4, 'detached 
block before' ),
                                        self::makeCacheAction( 33, 4, 'detached 
block after' ),
 
                                        self::makeCacheAction( 21, 2, 'single 
chunk match' ),
diff --git a/lib/tests/phpunit/store/MockChunkAccess.php 
b/lib/tests/phpunit/store/MockChunkAccess.php
index 7c07c8c..27c1b91 100644
--- a/lib/tests/phpunit/store/MockChunkAccess.php
+++ b/lib/tests/phpunit/store/MockChunkAccess.php
@@ -62,7 +62,7 @@
 
                        $chunk[] = $rec;
                        $c++;
-               } while( next( $this->data ) );
+               } while ( next( $this->data ) );
 
                return $chunk;
        }
diff --git a/lib/tests/phpunit/store/MockTermIndex.php 
b/lib/tests/phpunit/store/MockTermIndex.php
index e0d8bcf..0a33495 100644
--- a/lib/tests/phpunit/store/MockTermIndex.php
+++ b/lib/tests/phpunit/store/MockTermIndex.php
@@ -159,7 +159,7 @@
        ) {
                $entityIds = array();
 
-               foreach( $this->terms as $term ) {
+               foreach ( $this->terms as $term ) {
                        if ( $languageCode !== null && $term->getLanguage() !== 
$languageCode ) {
                                continue;
                        }
@@ -340,8 +340,8 @@
                $terms = $this->getMatchingTerms( $terms, $termType, 
$entityType, $options );
                $previousEntityIdSerializations = array();
                $returnTerms = array();
-               foreach( $terms as $termIndexEntry ) {
-                       if( !in_array( 
$termIndexEntry->getEntityId()->getSerialization(), 
$previousEntityIdSerializations ) ) {
+               foreach ( $terms as $termIndexEntry ) {
+                       if ( !in_array( 
$termIndexEntry->getEntityId()->getSerialization(), 
$previousEntityIdSerializations ) ) {
                                $returnTerms[] = $termIndexEntry;
                                $previousEntityIdSerializations[] = 
$termIndexEntry->getEntityId()->getSerialization();
                        }
diff --git a/lib/tests/phpunit/store/Sql/SiteLinkTableTest.php 
b/lib/tests/phpunit/store/Sql/SiteLinkTableTest.php
index aef60c4..d19bbda 100644
--- a/lib/tests/phpunit/store/Sql/SiteLinkTableTest.php
+++ b/lib/tests/phpunit/store/Sql/SiteLinkTableTest.php
@@ -48,7 +48,7 @@
                        'jawiki' => 'ビール'
                );
 
-               foreach( $siteLinks as $siteId => $pageName ) {
+               foreach ( $siteLinks as $siteId => $pageName ) {
                        $item->getSiteLinkList()->addNewSiteLink( $siteId, 
$pageName );
                }
 
@@ -116,7 +116,7 @@
        public function testGetItemIdForSiteLink( Item $item ) {
                $siteLinks = $item->getSiteLinks();
 
-               foreach( $siteLinks as $siteLink ) {
+               foreach ( $siteLinks as $siteLink ) {
                        $this->assertEquals(
                                $item->getId(),
                                $this->siteLinkTable->getItemIdForSiteLink( 
$siteLink )
diff --git a/lib/tests/phpunit/store/TermIndexTest.php 
b/lib/tests/phpunit/store/TermIndexTest.php
index e2bf15a..ef3e662 100644
--- a/lib/tests/phpunit/store/TermIndexTest.php
+++ b/lib/tests/phpunit/store/TermIndexTest.php
@@ -58,7 +58,7 @@
                $item0 = new Item( new ItemId( 'Q10' ) );
                $item0->setLabel( 'en', 'kittens' );
 
-               $item1 = new Item( new ItemId( 'Q11' )  );
+               $item1 = new Item( new ItemId( 'Q11' ) );
                $item1->setLabel( 'nl', 'mittens' );
                $item1->setLabel( 'de', 'Mittens' );
                $item1->setLabel( 'fr', 'kittens love mittens' );
@@ -230,7 +230,7 @@
 
                $actualTermKeys = array_map( array( $this, 'getTermKey' ), 
$actual );
 
-               if( !array_key_exists( 'orderByWeight', $options ) || 
$options['orderByWeight'] === false ) {
+               if ( !array_key_exists( 'orderByWeight', $options ) || 
$options['orderByWeight'] === false ) {
                        $this->assertArrayEquals( $expectedTermKeys, 
$actualTermKeys, false );
                } else {
                        $this->assertArrayEquals( $expectedTermKeys, 
$actualTermKeys, true );
@@ -350,8 +350,8 @@
 
                $abc = new TermIndexEntry( array( 'termType' => 
TermIndexEntry::TYPE_LABEL, 'termText' => 'abc' ) );
                $matchedTerms = $lookup->getMatchingTerms( array( $abc ), 
array( TermIndexEntry::TYPE_LABEL ), Item::ENTITY_TYPE );
-               foreach( $matchedTerms as $matchedTerm ) {
-                       if( $matchedTerm->getEntityId() === $id ) {
+               foreach ( $matchedTerms as $matchedTerm ) {
+                       if ( $matchedTerm->getEntityId() === $id ) {
                                $this->fail( 'Failed to delete term or entity: 
' . $id->getSerialization() );
                        }
                }
diff --git a/purtle/src/N3RdfWriterBase.php b/purtle/src/N3RdfWriterBase.php
index 23aa8b4..fe6b97b 100644
--- a/purtle/src/N3RdfWriterBase.php
+++ b/purtle/src/N3RdfWriterBase.php
@@ -23,7 +23,7 @@
 
        protected function writeRef( $base, $local = null ) {
                if ( $local === null ) {
-                       if( $base === 'a' ) {
+                       if ( $base === 'a' ) {
                                $this->write( 'a' );
                        } else {
                                $this->writeIRI( $base );
diff --git a/purtle/src/RdfWriterBase.php b/purtle/src/RdfWriterBase.php
index 132af9c..60940bd 100644
--- a/purtle/src/RdfWriterBase.php
+++ b/purtle/src/RdfWriterBase.php
@@ -145,8 +145,8 @@
         * @param string $iri The base IRI
         */
        public function prefix( $prefix, $iri ) {
-               if( $this->prefixesLocked ) {
-                       throw new \LogicException("Prefixes can not be added 
after start()");
+               if ( $this->prefixesLocked ) {
+                       throw new \LogicException( "Prefixes can not be added 
after start()" );
                }
                $this->prefixes[$prefix] = $iri;
        }
@@ -297,7 +297,7 @@
         */
        final public function drain() {
                // we can drain after finish, but finish state is sticky
-               if( $this->state != self::STATE_FINISH ) {
+               if ( $this->state !== self::STATE_FINISH ) {
                        $this->state( self::STATE_DOCUMENT );
                }
 
diff --git a/purtle/src/TurtleRdfWriter.php b/purtle/src/TurtleRdfWriter.php
index 636d309..14d953b 100644
--- a/purtle/src/TurtleRdfWriter.php
+++ b/purtle/src/TurtleRdfWriter.php
@@ -42,7 +42,7 @@
                
$this->transitionTable[self::STATE_SUBJECT][self::STATE_PREDICATE] = " ";
                
$this->transitionTable[self::STATE_PREDICATE][self::STATE_OBJECT] = " ";
                $self = $this;
-               $this->transitionTable[self::STATE_START][self::STATE_DOCUMENT] 
= function() use($self) {
+               $this->transitionTable[self::STATE_START][self::STATE_DOCUMENT] 
= function() use ( $self ) {
                        $self->beginDocument();
                };
        }
@@ -50,14 +50,14 @@
        /**
         * Write prefixes
         */
-       public function beginDocument( ) {
-               foreach( $this->getPrefixes() as $prefix => $uri ) {
+       public function beginDocument() {
+               foreach ( $this->getPrefixes() as $prefix => $uri ) {
                        $this->write( "@prefix $prefix: <" . 
$this->quoter->escapeIRI( $uri ) . "> .\n" );
                }
        }
 
        protected function writeSubject( $base, $local = null ) {
-               if( $local !== null ) {
+               if ( $local !== null ) {
                        $this->write( "$base:$local" );
                } else {
                        $this->writeIRI( $base, $this->trustIRIs );
@@ -65,11 +65,11 @@
        }
 
        protected function writePredicate( $base, $local = null ) {
-               if( $base === 'a' ) {
+               if ( $base === 'a' ) {
                        $this->write( 'a' );
                        return;
                }
-               if( $local !== null ) {
+               if ( $local !== null ) {
                        $this->write( "$base:$local" );
                } else {
                        $this->writeIRI( $base, $this->trustIRIs );
@@ -77,7 +77,7 @@
        }
 
        protected function writeResource( $base, $local = null ) {
-               if( $local !== null) {
+               if ( $local !== null ) {
                        $this->write( "$base:$local" );
                } else {
                        $this->writeIRI( $base );
diff --git a/purtle/src/UnicodeEscaper.php b/purtle/src/UnicodeEscaper.php
index 3a0ca45..491265c 100644
--- a/purtle/src/UnicodeEscaper.php
+++ b/purtle/src/UnicodeEscaper.php
@@ -52,7 +52,7 @@
                for ( $i = 0; $i < $strLen; $i++ ) {
                        $c = mb_substr( $str, $i, 1, 'UTF-8' );
                        if ( !isset( $this->escChars[$c] ) ) {
-                               $this->escChars[$c] = $this->escapedChar($c);
+                               $this->escChars[$c] = $this->escapedChar( $c );
                        }
                        $result .= $this->escChars[$c];
                }
diff --git a/purtle/src/XmlRdfWriter.php b/purtle/src/XmlRdfWriter.php
index 6e4c82b..e18f33b 100644
--- a/purtle/src/XmlRdfWriter.php
+++ b/purtle/src/XmlRdfWriter.php
@@ -18,17 +18,17 @@
                // Also due to PHP 5.3 scope issues, used functions need to be 
public.
                // TODO: seek better solution (or move to PHP 5.4+)
                $self = $this;
-               $this->transitionTable[self::STATE_START][self::STATE_DOCUMENT] 
= function() use($self) {
+               $this->transitionTable[self::STATE_START][self::STATE_DOCUMENT] 
= function() use ( $self ) {
                        $self->beginDocument();
                };
-               array($this, 'beginDocument');
-               
$this->transitionTable[self::STATE_DOCUMENT][self::STATE_FINISH] = function() 
use($self) {
+               array( $this, 'beginDocument' );
+               
$this->transitionTable[self::STATE_DOCUMENT][self::STATE_FINISH] = function() 
use ( $self ) {
                        $self->finishDocument();
                };
-               
$this->transitionTable[self::STATE_OBJECT][self::STATE_DOCUMENT] = function() 
use($self) {
+               
$this->transitionTable[self::STATE_OBJECT][self::STATE_DOCUMENT] = function() 
use ( $self ) {
                        $self->finishSubject();
                };
-               $this->transitionTable[self::STATE_OBJECT][self::STATE_SUBJECT] 
= function() use($self) {
+               $this->transitionTable[self::STATE_OBJECT][self::STATE_SUBJECT] 
= function() use ( $self ) {
                        $self->finishSubject();
                };
        }
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 1f3cce6..25833f5 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -82,7 +82,7 @@
                        throw new MWException( 'Wikibase: Incomplete 
configuration: '
                                . '$wgWBRepoSettings["entityNamespaces"] has to 
be set to an '
                                . 'array mapping content model IDs to namespace 
IDs. '
-                               . 'See ExampleSettings.php for details and 
examples.');
+                               . 'See ExampleSettings.php for details and 
examples.' );
                }
 
                foreach ( $namespaces as $contentModel => $namespace ) {
@@ -287,7 +287,9 @@
 
                // Notify storage/lookup services that the entity was deleted. 
Needed to track page-level deletion.
                // May be redundant in some cases. Take care not to cause 
infinite regress.
-               
WikibaseRepo::getDefaultInstance()->getEntityStoreWatcher()->entityDeleted( 
$content->getEntityId() );
+               WikibaseRepo::getDefaultInstance()
+                       ->getEntityStoreWatcher()
+                       ->entityDeleted( $content->getEntityId() );
 
                $notifier = 
WikibaseRepo::getDefaultInstance()->getChangeNotifier();
                $notifier->notifyOnPageDeleted( $content, $user, 
$logEntry->getTimestamp() );
@@ -1051,7 +1053,9 @@
        public static function onImportHandleRevisionXMLTag( $importer, 
$pageInfo, $revisionInfo ) {
                if ( isset( $revisionInfo['model'] ) ) {
                        $contentModels = 
WikibaseRepo::getDefaultInstance()->getContentModelMappings();
-                       $allowImport = 
WikibaseRepo::getDefaultInstance()->getSettings()->getSetting( 
'allowEntityImport' );
+                       $allowImport = WikibaseRepo::getDefaultInstance()
+                               ->getSettings()
+                               ->getSetting( 'allowEntityImport' );
 
                        if ( !$allowImport && in_array( $revisionInfo['model'], 
$contentModels ) ) {
                                // Skip entities.
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index 8bb8f05..edfa78b 100644
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -67,7 +67,7 @@
 }
 
 if ( !defined( 'WIKIBASE_VIEW_VERSION' ) ) {
-    throw new Exception( 'Wikibase depends on WikibaseView.' );
+       throw new Exception( 'Wikibase depends on WikibaseView.' );
 }
 
 if ( !defined( 'PURTLE_VERSION' ) ) {
diff --git a/repo/includes/ChangeOp/ChangeOpQualifierRemove.php 
b/repo/includes/ChangeOp/ChangeOpQualifierRemove.php
index e2204b7..7c5f574 100644
--- a/repo/includes/ChangeOp/ChangeOpQualifierRemove.php
+++ b/repo/includes/ChangeOp/ChangeOpQualifierRemove.php
@@ -48,7 +48,7 @@
                        throw new InvalidArgumentException( '$statementGuid 
needs to be a string and must not be empty' );
                }
 
-               if ( !is_string( $snakHash ) || $snakHash === ''  ) {
+               if ( !is_string( $snakHash ) || $snakHash === '' ) {
                        throw new InvalidArgumentException( '$snakHash needs to 
be a string and must not be empty' );
                }
 
diff --git a/repo/includes/ChangeOp/ChangeOpReference.php 
b/repo/includes/ChangeOp/ChangeOpReference.php
index 01e02a2..63a1752 100644
--- a/repo/includes/ChangeOp/ChangeOpReference.php
+++ b/repo/includes/ChangeOp/ChangeOpReference.php
@@ -165,7 +165,7 @@
 
                $currentIndex = $references->indexOf( $this->reference );
 
-               if( is_null( $this->index ) && $currentIndex !== false ) {
+               if ( $this->index === null && $currentIndex !== false ) {
                        // Set index to current index to not have the reference 
removed and appended but
                        // retain its position within the list of references.
                        $this->index = $currentIndex;
diff --git a/repo/includes/ChangePruner.php b/repo/includes/ChangePruner.php
index 8a3e438..a76ec90 100644
--- a/repo/includes/ChangePruner.php
+++ b/repo/includes/ChangePruner.php
@@ -57,7 +57,7 @@
         * Prunes the wb_changes table.
         */
        public function prune() {
-               while( true ) {
+               while ( true ) {
                        wfWaitForSlaves();
 
                        $until = $this->getCutoffTimestamp();
diff --git a/repo/includes/Diff/ClaimDiffer.php 
b/repo/includes/Diff/ClaimDiffer.php
index e40a2df..e6c1796 100644
--- a/repo/includes/Diff/ClaimDiffer.php
+++ b/repo/includes/Diff/ClaimDiffer.php
@@ -105,7 +105,7 @@
                $oldRank = $oldStatement === null ? null : 
$oldStatement->getRank();
                $newRank = $newStatement === null ? null : 
$newStatement->getRank();
 
-               if( $oldRank !== $newRank ) {
+               if ( $oldRank !== $newRank ) {
                        return new DiffOpChange( $oldRank, $newRank );
                }
 
diff --git a/repo/includes/Dumpers/RdfDumpGenerator.php 
b/repo/includes/Dumpers/RdfDumpGenerator.php
index 6dc3804..d2aebf2 100644
--- a/repo/includes/Dumpers/RdfDumpGenerator.php
+++ b/repo/includes/Dumpers/RdfDumpGenerator.php
@@ -166,7 +166,7 @@
                        EntityPrefetcher $entityPrefetcher
        ) {
                $rdfWriter = self::getRdfWriter( $format );
-               if( !$rdfWriter ) {
+               if ( !$rdfWriter ) {
                        throw new MWException( "Unknown format: $format" );
                }
 
diff --git a/repo/includes/EntityParserOutputGenerator.php 
b/repo/includes/EntityParserOutputGenerator.php
index a5f2ce4..b2712f1 100644
--- a/repo/includes/EntityParserOutputGenerator.php
+++ b/repo/includes/EntityParserOutputGenerator.php
@@ -161,8 +161,8 @@
                $usedEntityIds = 
$this->referencedEntitiesFinder->findSnakLinks( $snaks );
 
                // FIXME: Bad
-               if( $entity instanceof Item ) {
-                       foreach( $entity->getSiteLinkList()->getIterator() as 
$sitelink ) {
+               if ( $entity instanceof Item ) {
+                       foreach ( $entity->getSiteLinkList()->getIterator() as 
$sitelink ) {
                                $usedEntityIds = array_merge( $usedEntityIds, 
$sitelink->getBadges() );
                        }
                }
@@ -229,7 +229,7 @@
        private function addEntityLinksToParserOutput( ParserOutput 
$parserOutput, array $entityIds ) {
                $linkBatch = new LinkBatch();
 
-               foreach( $entityIds as $entityId ) {
+               foreach ( $entityIds as $entityId ) {
                        $linkBatch->addObj( 
$this->entityTitleLookup->getTitleForId( $entityId ) );
                }
 
@@ -239,7 +239,7 @@
                        return;
                }
 
-               foreach( $pages as $page ) {
+               foreach ( $pages as $page ) {
                        $title = Title::makeTitle( $page->page_namespace, 
$page->page_title );
                        $parserOutput->addLink( $title, $page->page_id );
                }
diff --git a/repo/includes/Hooks/EditFilterHookRunner.php 
b/repo/includes/Hooks/EditFilterHookRunner.php
index cfd2cbb..9a3e16d 100644
--- a/repo/includes/Hooks/EditFilterHookRunner.php
+++ b/repo/includes/Hooks/EditFilterHookRunner.php
@@ -116,7 +116,7 @@
         * @return IContextSource
         */
        private function getContextForEditFilter( EntityId $entityId = null, 
$entityType ) {
-               if( $entityId !== null ) {
+               if ( $entityId !== null ) {
                        $title = $this->titleLookup->getTitleForId( $entityId );
                        $context = clone $this->context;
                } else {
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index dd84af8..1d091a1 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -1142,7 +1142,7 @@
        }
 
        private function getMonolingualTextLanguages() {
-               if( $this->monolingualTextLanguages === null ) {
+               if ( $this->monolingualTextLanguages === null ) {
                        $this->monolingualTextLanguages = new 
WikibaseContentLanguages();
                }
                return $this->monolingualTextLanguages;
diff --git a/repo/includes/actions/EditEntityAction.php 
b/repo/includes/actions/EditEntityAction.php
index 4aee2cc..5e52e1c 100644
--- a/repo/includes/actions/EditEntityAction.php
+++ b/repo/includes/actions/EditEntityAction.php
@@ -136,7 +136,7 @@
         * @return Status a Status object containing an array with three 
revisions, ($olderRevision, $newerRevision, $latestRevision)
         * @throws MWException if the page's latest revision cannot be loaded
         */
-       protected function loadRevisions( ) {
+       protected function loadRevisions() {
                $latestRevId = $this->getTitle()->getLatestRevID();
 
                if ( $latestRevId === 0 ) {
diff --git a/repo/includes/actions/ViewEntityAction.php 
b/repo/includes/actions/ViewEntityAction.php
index ab2b050..c3367fd 100644
--- a/repo/includes/actions/ViewEntityAction.php
+++ b/repo/includes/actions/ViewEntityAction.php
@@ -140,10 +140,12 @@
 
                # Show delete and move logs
                LogEventsList::showLogExtract( $out, array( 'delete', 'move' ), 
$title, '',
-                       array(  'lim' => 10,
-                               'conds' => array( "log_action != 'revision'" ),
-                               'showIfEmpty' => false,
-                               'msgKey' => array( 'moveddeleted-notice' ) )
+                       array(
+                               'lim' => 10,
+                               'conds' => array( "log_action != 'revision'" ),
+                               'showIfEmpty' => false,
+                               'msgKey' => array( 'moveddeleted-notice' )
+                       )
                );
 
                $this->send404Code();
diff --git a/repo/includes/api/GetEntities.php 
b/repo/includes/api/GetEntities.php
index bd63c3d..13d9b14 100644
--- a/repo/includes/api/GetEntities.php
+++ b/repo/includes/api/GetEntities.php
@@ -95,7 +95,7 @@
                $entityIds = $this->getEntityIdsFromParams( $params );
                $entityRevisions = $this->getEntityRevisionsFromEntityIds( 
$entityIds, $resolveRedirects );
 
-               foreach( $entityRevisions as $sourceEntityId => $entityRevision 
) {
+               foreach ( $entityRevisions as $sourceEntityId => 
$entityRevision ) {
                        $this->handleEntity( $sourceEntityId, $entityRevision, 
$params );
                }
 
@@ -125,11 +125,11 @@
         */
        private function getEntityIdsFromIdParam( $params ) {
                $ids = array();
-               if( isset( $params['ids'] ) ) {
-                       foreach( $params['ids'] as $id ) {
+               if ( isset( $params['ids'] ) ) {
+                       foreach ( $params['ids'] as $id ) {
                                try {
                                        $ids[] = $this->getIdParser()->parse( 
$id );
-                               } catch( EntityIdParsingException $e ) {
+                               } catch ( EntityIdParsingException $e ) {
                                        $this->dieError( "Invalid id: $id", 
'no-such-entity' );
                                }
                        }
@@ -169,7 +169,7 @@
         * @param array $missingItems Array of arrays, Each internal array has 
a key 'site' and 'title'
         */
        private function addMissingItemsToResult( $missingItems ) {
-               foreach( $missingItems as $missingItem ) {
+               foreach ( $missingItems as $missingItem ) {
                        $this->getResultBuilder()->addMissingEntity( null, 
$missingItem );
                }
        }
@@ -274,7 +274,7 @@
                } else {
                        $languages = $params['languages'];
                }
-               if( $params['ungroupedlist'] ) {
+               if ( $params['ungroupedlist'] ) {
                        $options->setOption(
                                        
SerializationOptions::OPT_GROUP_BY_PROPERTIES,
                                        array()
diff --git a/repo/includes/api/SetReference.php 
b/repo/includes/api/SetReference.php
index be10d7e..26fb3d0 100644
--- a/repo/includes/api/SetReference.php
+++ b/repo/includes/api/SetReference.php
@@ -68,7 +68,7 @@
                        $this->validateReferenceHash( $claim, 
$params['reference'] );
                }
 
-               if( isset( $params['snaks-order' ] ) ) {
+               if ( isset( $params['snaks-order' ] ) ) {
                        $snaksOrder = $this->getArrayFromParam( 
$params['snaks-order'] );
                } else {
                        $snaksOrder = array();
@@ -140,7 +140,7 @@
                $snakOrder = ( count( $snakOrder ) > 0 ) ? $snakOrder : 
array_keys( $rawSnaks );
 
                try {
-                       foreach( $snakOrder as $propertyId ) {
+                       foreach ( $snakOrder as $propertyId ) {
                                if ( !is_array( $rawSnaks[$propertyId] ) ) {
                                        $this->dieError( 'Invalid snak JSON 
given', 'invalid-json' );
                                }
@@ -153,14 +153,14 @@
                                        $snaks[] = $snak;
                                }
                        }
-               } catch( InvalidArgumentException $invalidArgumentException ) {
+               } catch ( InvalidArgumentException $invalidArgumentException ) {
                        // Handle Snak instantiation failures
                        $this->dieError(
                                'Failed to get reference from reference 
Serialization '
                                        . 
$invalidArgumentException->getMessage(),
                                'snak-instantiation-failure'
                        );
-               } catch( OutOfBoundsException $outOfBoundsException ) {
+               } catch ( OutOfBoundsException $outOfBoundsException ) {
                        $this->dieError(
                                'Failed to get reference from reference 
Serialization '
                                        . $outOfBoundsException->getMessage(),
diff --git a/repo/includes/content/EntityContentFactory.php 
b/repo/includes/content/EntityContentFactory.php
index 05b9d52..77098cb 100644
--- a/repo/includes/content/EntityContentFactory.php
+++ b/repo/includes/content/EntityContentFactory.php
@@ -271,7 +271,7 @@
                $status = Status::newGood();
 
                foreach ( $errors as $error ) {
-                       call_user_func_array( array( $status, 'fatal'), $error 
);
+                       call_user_func_array( array( $status, 'fatal' ), $error 
);
                        $status->setResult( false );
                }
 
diff --git a/repo/includes/content/EntityHandler.php 
b/repo/includes/content/EntityHandler.php
index f021f99..dabf99c 100644
--- a/repo/includes/content/EntityHandler.php
+++ b/repo/includes/content/EntityHandler.php
@@ -366,7 +366,7 @@
         * @return string
         */
        public function serializeContent( Content $content, $format = null ) {
-               if ( !($content instanceof EntityContent) ) {
+               if ( !( $content instanceof EntityContent ) ) {
                        throw new InvalidArgumentException( '$content must be 
an instance of EntityContent' );
                }
 
diff --git a/repo/includes/rdf/DateTimeValueCleaner.php 
b/repo/includes/rdf/DateTimeValueCleaner.php
index c1bdc27..c421a41 100644
--- a/repo/includes/rdf/DateTimeValueCleaner.php
+++ b/repo/includes/rdf/DateTimeValueCleaner.php
@@ -20,48 +20,48 @@
         * @return string Value compatible with xsd:dateTime type
         */
        protected function cleanupGregorianValue( $dateValue ) {
-               list($date, $time) = explode( "T", $dateValue, 2 );
-               if( $date[0] == "-" ) {
-                       $minus = "-";
+               list( $date, $time ) = explode( 'T', $dateValue, 2 );
+               if ( $date[0] === '-' ) {
+                       $minus = '-';
                } else {
-                       $minus = "";
+                       $minus = '';
                }
-               list($y, $m, $d) = explode( "-", substr( $date, 1 ), 3 );
+               list( $y, $m, $d ) = explode( '-', substr( $date, 1 ), 3 );
 
                $m = (int)$m;
                $d = (int)$d;
-               $y = ltrim($y, '0');
+               $y = ltrim( $y, '0' );
 
-               if($y === "") {
+               if ( $y === '' ) {
                        // Year 0 is invalid for now, see T94064 for discussion
                        return null;
                }
 
-               if( $m <= 0 ) {
+               if ( $m <= 0 ) {
                        $m = 1;
                }
-               if( $m >= 12 ) {
+               if ( $m >= 12 ) {
                        // Why anybody would do something like that? Anyway, 
better to check.
                        $m = 12;
                }
-               if( $d <= 0 ) {
+               if ( $d <= 0 ) {
                        $d = 1;
                }
                // check if the date "looks safe". If not, we do deeper check
-               if( !( $d <= 28 || ( $m != 2 && $d <= 30 ) ) ) {
+               if ( !( $d <= 28 || ( $m != 2 && $d <= 30 ) ) ) {
                        // PHP source docs say PHP gregorian calendar can work 
down to 4714 BC
                        // Use float conversion here since we don't care about 
precision but don't want overflows.
-                       if( $minus && (float)$y >= 4714 ) {
+                       if ( $minus && (float)$y >= 4714 ) {
                                $safeYear = -4713;
                        } else {
-                               $safeYear = (int)$y * ($minus?-1:1);
+                               $safeYear = (int)$y * ( $minus ? -1 : 1 );
                        }
 
                        // This will convert $y to int. If it's not within sane 
range,
                        // Feb 29 may be mangled, but this will be rare.
                        $max = cal_days_in_month( CAL_GREGORIAN, $m, $safeYear 
);
                        // We just put it as the last day in month, won't 
bother further
-                       if( $d > $max ) {
+                       if ( $d > $max ) {
                                $d = $max;
                        }
                }
@@ -69,7 +69,7 @@
                // and leading 0 is not allowed for 5 digits
                // But sprintf counts - as digit
                // See: http://www.w3.org/TR/xmlschema-2/#dateTime
-               return sprintf( "%s%04s-%02d-%02dT%s", $minus, $y, $m, $d, 
$time );
+               return sprintf( '%s%04s-%02d-%02dT%s', $minus, $y, $m, $d, 
$time );
        }
 
        /**
diff --git a/repo/includes/rdf/FullStatementRdfBuilder.php 
b/repo/includes/rdf/FullStatementRdfBuilder.php
index 8cbc777..383182b 100644
--- a/repo/includes/rdf/FullStatementRdfBuilder.php
+++ b/repo/includes/rdf/FullStatementRdfBuilder.php
@@ -242,7 +242,7 @@
                if ( isset( RdfVocabulary::$rankMap[$rank] ) ) {
                        $this->statementWriter->about( 
RdfVocabulary::NS_STATEMENT, $statementLName )
                                ->say( RdfVocabulary::NS_ONTOLOGY, 'rank' 
)->is( RdfVocabulary::NS_ONTOLOGY, RdfVocabulary::$rankMap[$rank] );
-                       if( $isBest ) {
+                       if ( $isBest ) {
                                $this->statementWriter->say( 
RdfVocabulary::NS_ONTOLOGY, 'rank' )->is( RdfVocabulary::NS_ONTOLOGY, 
RdfVocabulary::WIKIBASE_RANK_BEST );
                        }
                } else {
diff --git a/repo/includes/rdf/JulianDateTimeValueCleaner.php 
b/repo/includes/rdf/JulianDateTimeValueCleaner.php
index d2b1964..2b66d10 100644
--- a/repo/includes/rdf/JulianDateTimeValueCleaner.php
+++ b/repo/includes/rdf/JulianDateTimeValueCleaner.php
@@ -27,29 +27,29 @@
         * @return string|null Value compatible with xsd:dateTime type, null if 
we failed to parse
         */
        protected function julianDateValue( $dateValue ) {
-               list($date, $time) = explode( "T", $dateValue, 2 );
-               if ( $date[0] == '-' ) {
-                       list($y, $m, $d) = explode( "-", substr( $date, 1 ), 3 
);
+               list( $date, $time ) = explode( 'T', $dateValue, 2 );
+               if ( $date[0] === '-' ) {
+                       list( $y, $m, $d ) = explode( '-', substr( $date, 1 ), 
3 );
                        $y = -(int)$y;
                } else {
-                       list($y, $m, $d) = explode( "-", $date, 3 );
+                       list( $y, $m, $d ) = explode( '-', $date, 3 );
                        $y = (int)$y;
                }
                // cal_to_jd needs int year
                // If it's too small it's fine, we'll get 0
                // If it's too big, it doesn't make sense anyway since who uses 
Julian in year 2 billion?
                $jd = cal_to_jd( CAL_JULIAN, $m, $d, (int)$y );
-               if( $jd == 0 ) {
+               if ( $jd == 0 ) {
                        // that means the date is broken
                        return null;
                }
                // PHP API for Julian is kind of awful
-               list($m, $d, $y) = explode( '/', jdtogregorian( $jd ) );
+               list( $m, $d, $y ) = explode( '/', jdtogregorian( $jd ) );
                // This is a bit weird since xsd:dateTime requires >=4 digit 
always,
                // and leading 0 is not allowed for 5 digits
                // But sprintf counts - as digit
                // See: http://www.w3.org/TR/xmlschema-2/#dateTime
-               return sprintf( "%s%04d-%02d-%02dT%s", ($y < 0)? "-":"", abs( 
$y ), $m, $d, $time );
+               return sprintf( '%s%04d-%02d-%02dT%s', ( $y < 0 ) ? '-' : '', 
abs( $y ), $m, $d, $time );
        }
 
        /**
diff --git a/repo/includes/rdf/RdfBuilder.php b/repo/includes/rdf/RdfBuilder.php
index bd3ccbd..b4bca0a 100644
--- a/repo/includes/rdf/RdfBuilder.php
+++ b/repo/includes/rdf/RdfBuilder.php
@@ -303,8 +303,8 @@
         * @param boolean $isObjectProperty Is the property data or object 
property?
         */
        private function writePropertyPredicates( $id, $isObjectProperty ) {
-               $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 
'directClaim')->is( RdfVocabulary::NSP_DIRECT_CLAIM, $id );
-               $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 'claim')->is( 
RdfVocabulary::NSP_CLAIM, $id );
+               $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 'directClaim' 
)->is( RdfVocabulary::NSP_DIRECT_CLAIM, $id );
+               $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 'claim' )->is( 
RdfVocabulary::NSP_CLAIM, $id );
                $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 
'statementProperty' )->is( RdfVocabulary::NSP_CLAIM_STATEMENT, $id );
                $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 
'statementValue' )->is( RdfVocabulary::NSP_CLAIM_VALUE, $id );
                $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 'qualifier' 
)->is( RdfVocabulary::NSP_QUALIFIER, $id );
@@ -318,7 +318,7 @@
                $this->writer->about( RdfVocabulary::NSP_QUALIFIER_VALUE, $id 
)->a( 'owl', 'ObjectProperty' );
                $this->writer->about( RdfVocabulary::NSP_REFERENCE_VALUE, $id 
)->a( 'owl', 'ObjectProperty' );
                // Depending on property type
-               if( $isObjectProperty ) {
+               if ( $isObjectProperty ) {
                        $datatype = 'ObjectProperty';
                } else {
                        $datatype = 'DatatypeProperty';
@@ -368,7 +368,7 @@
                $this->writer->about( RdfVocabulary::NS_ENTITY, $entityLName )
                        ->a( RdfVocabulary::NS_ONTOLOGY, 
$this->vocabulary->getEntityTypeName( $entity->getType() ) );
 
-               if( $entity instanceof Property ) {
+               if ( $entity instanceof Property ) {
                        $this->writer->say( RdfVocabulary::NS_ONTOLOGY, 
'propertyType' )
                                ->is( RdfVocabulary::NS_ONTOLOGY, 
$this->vocabulary->getDataTypeName( $entity ) );
                        $id = $entity->getId()->getSerialization();
@@ -491,7 +491,7 @@
                        ->a( RdfVocabulary::NS_SCHEMA_ORG, "Dataset" )
                        ->say( RdfVocabulary::NS_CC, 'license' )->is( 
RdfVocabulary::LICENSE )
                        ->say( RdfVocabulary::NS_SCHEMA_ORG, 'softwareVersion' 
)->value( RdfVocabulary::FORMAT_VERSION )
-                       ->say( RdfVocabulary::NS_SCHEMA_ORG, 'dateModified' 
)->value( wfTimestamp( TS_ISO_8601, $timestamp ), 'xsd', 'dateTime'  );
+                       ->say( RdfVocabulary::NS_SCHEMA_ORG, 'dateModified' 
)->value( wfTimestamp( TS_ISO_8601, $timestamp ), 'xsd', 'dateTime' );
        }
 
 }
diff --git a/repo/includes/store/sql/ChangesSubscriptionTableBuilder.php 
b/repo/includes/store/sql/ChangesSubscriptionTableBuilder.php
index 3b27835..d69beaa 100644
--- a/repo/includes/store/sql/ChangesSubscriptionTableBuilder.php
+++ b/repo/includes/store/sql/ChangesSubscriptionTableBuilder.php
@@ -179,7 +179,7 @@
                                        . ' into wb_changes_subscription' );
                        }
 
-                       $c+= count( $rows );
+                       $c += count( $rows );
                }
 
                $db->endAtomic( __METHOD__ );
diff --git a/repo/includes/store/sql/EntityPerPageTable.php 
b/repo/includes/store/sql/EntityPerPageTable.php
index 044caf1..37b63bf 100644
--- a/repo/includes/store/sql/EntityPerPageTable.php
+++ b/repo/includes/store/sql/EntityPerPageTable.php
@@ -350,7 +350,7 @@
         * @return EntityId[]
         */
        public function listEntities( $entityType, $limit, EntityId $after = 
null, $redirects = self::NO_REDIRECTS ) {
-               if ( $entityType == null  ) {
+               if ( $entityType === null ) {
                        $where = array();
                        //NOTE: needs to be id/type, not type/id, according to 
the definition of the relevant
                        //      index in wikibase.sql: wb_entity_per_page 
(epp_entity_id, epp_entity_type);
diff --git a/repo/includes/store/sql/PropertyInfoTableBuilder.php 
b/repo/includes/store/sql/PropertyInfoTableBuilder.php
index 9ded71e..89ef8e6 100644
--- a/repo/includes/store/sql/PropertyInfoTableBuilder.php
+++ b/repo/includes/store/sql/PropertyInfoTableBuilder.php
@@ -243,7 +243,7 @@
        private function updatePropertyInfo( PropertyId $id ) {
                $property = $this->entityLookup->getEntity( $id );
 
-               if( !$property instanceof Property ) {
+               if ( !$property instanceof Property ) {
                        throw new RuntimeException(
                                'EntityLookup did not return a Property for id 
' . $id->getSerialization()
                        );
diff --git a/repo/includes/store/sql/SqlChangeDispatchCoordinator.php 
b/repo/includes/store/sql/SqlChangeDispatchCoordinator.php
index 92ea8f0..dc2c09f 100644
--- a/repo/includes/store/sql/SqlChangeDispatchCoordinator.php
+++ b/repo/includes/store/sql/SqlChangeDispatchCoordinator.php
@@ -319,7 +319,7 @@
         * @param  string|bool  $wikiDB: the logical name of the client wiki's 
database.
         * @param DatabaseBase $db: the client database connection to release 
for re-use.
         */
-       private function releaseClientMaster( $wikiDB, DatabaseBase $db  ) {
+       private function releaseClientMaster( $wikiDB, DatabaseBase $db ) {
                $this->getClientLB( $wikiDB )->reuseConnection( $db );
        }
 
diff --git a/repo/includes/store/sql/TermSearchKeyBuilder.php 
b/repo/includes/store/sql/TermSearchKeyBuilder.php
index 1f74943..5e6ad0b 100644
--- a/repo/includes/store/sql/TermSearchKeyBuilder.php
+++ b/repo/includes/store/sql/TermSearchKeyBuilder.php
@@ -162,7 +162,7 @@
                                        $this->report( "Unable to calculate 
search key for " . $row->term_text );
                                        $cError += 1;
                                } else {
-                                       $c+= 1;
+                                       $c += 1;
                                }
 
                                $rowId = $row->term_row_id;
diff --git a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php 
b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
index 759281d..69b8ab7 100644
--- a/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
+++ b/repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
@@ -418,7 +418,7 @@
                $ids = array();
                $missingIds = array();
 
-               for ( $i = 1; $i<=100; $i++) {
+               for ( $i = 1; $i <= 100; $i++ ) {
                        $id = new ItemId( "Q$i" );
                        $ids[] = $id;
 
@@ -448,7 +448,7 @@
        public function testProgressReporter() {
                $ids = array();
 
-               for ( $i = 1; $i<=100; $i++) {
+               for ( $i = 1; $i <= 100; $i++ ) {
                        $id = new ItemId( "Q$i" );
                        $ids[] = $id;
                }
@@ -512,7 +512,7 @@
        public function testRedirectsNotIncluded() {
                $ids = array();
 
-               for ( $i = 1; $i<=10; $i++) {
+               for ( $i = 1; $i <= 10; $i++ ) {
                        $id = new ItemId( "Q$i" );
                        $ids[] = $id;
                }
diff --git a/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php 
b/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php
index 5f19943..3be5afe 100644
--- a/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php
+++ b/repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php
@@ -90,7 +90,7 @@
                        } ) );
 
                $entityRevisionLookup->expects( $this->any() )
-                       ->method ( 'getEntityRevision' )
+                       ->method( 'getEntityRevision' )
                        ->will( $this->returnCallback( function( EntityId $id ) 
use ( $entityLookup ) {
                                /** @var EntityLookup $entityLookup */
                                $entity = $entityLookup->getEntity( $id );
@@ -99,7 +99,7 @@
                                }
                                return new EntityRevision( $entity, 12, 
wfTimestamp( TS_MW, 1000000 ) );
                        }
-               ));
+               ) );
 
                return RdfDumpGenerator::createDumpGenerator(
                        'ntriples',
@@ -132,7 +132,7 @@
         *
         * @return string[]
         */
-       public function normalizeData($data) {
+       public function normalizeData( $data ) {
                $dataSplit = explode( "\n", $data );
                sort( $dataSplit );
                return $dataSplit;
@@ -161,7 +161,7 @@
                $entities = $jsonTest->makeEntities( $ids );
                $redirects = array( 'Q4242' => new ItemId( 'Q42' ) );
                $dumper = $this->newDumpGenerator( $entities, $redirects );
-               $dumper->setTimestamp(1000000);
+               $dumper->setTimestamp( 1000000 );
                $jsonTest = new JsonDumpGeneratorTest();
                $pager = $jsonTest->makeIdPager( $ids );
 
diff --git 
a/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php 
b/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
index 38ccc68..7937ea9 100644
--- a/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
+++ b/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
@@ -59,7 +59,7 @@
                }
 
                if ( $obLevel !== $this->obLevel ) {
-                       $this->fail( "Test changed output buffer level: was 
{$this->obLevel} before test, but $obLevel after test.");
+                       $this->fail( "Test changed output buffer level: was 
{$this->obLevel} before test, but $obLevel after test." );
                }
 
                parent::tearDown();
diff --git 
a/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteJobTest.php 
b/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteJobTest.php
index 3934e8a..8d8838d 100644
--- a/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteJobTest.php
+++ b/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteJobTest.php
@@ -76,7 +76,7 @@
                $entityPermissionChecker = $this->getMock( 
'Wikibase\Repo\Store\EntityPermissionChecker' );
                $entityPermissionChecker->expects( $this->any() )
                                ->method( 'getPermissionStatusForEntity' )
-                               ->will( $this->returnValue( Status::newGood() 
));
+                               ->will( $this->returnValue( Status::newGood() ) 
);
 
                return $entityPermissionChecker;
        }
@@ -88,7 +88,7 @@
                return $summaryFormatter;
        }
 
-       private function getMockEditFitlerHookRunner () {
+       private function getMockEditFitlerHookRunner() {
                $runner = $this->getMockBuilder( 
'Wikibase\Repo\Hooks\EditFilterHookRunner' )
                        ->setMethods( array( 'run' ) )
                        ->disableOriginalConstructor()
diff --git a/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveJobTest.php 
b/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveJobTest.php
index ff46fde..3dc6aba 100644
--- a/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveJobTest.php
+++ b/repo/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveJobTest.php
@@ -84,7 +84,7 @@
                return $summaryFormatter;
        }
 
-       private function getMockEditFitlerHookRunner () {
+       private function getMockEditFitlerHookRunner() {
                $runner = $this->getMockBuilder( 
'Wikibase\Repo\Hooks\EditFilterHookRunner' )
                        ->setMethods( array( 'run' ) )
                        ->disableOriginalConstructor()
diff --git 
a/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php 
b/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
index 9b9cd92..7698208 100644
--- a/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
@@ -114,7 +114,7 @@
                $dupeAliasFingerprint = new Fingerprint(
                        new TermList( array( new Term( 'de', 'good' ) ) ),
                        new TermList(),
-                       new AliasGroupList( array( new AliasGroup( 'de', array( 
'DUPE' )) ) )
+                       new AliasGroupList( array( new AliasGroup( 'de', array( 
'DUPE' ) ) ) )
                );
 
                return array(
diff --git a/repo/tests/phpunit/includes/actions/EditEntityActionTest.php 
b/repo/tests/phpunit/includes/actions/EditEntityActionTest.php
index ed82696..d7fee42 100644
--- a/repo/tests/phpunit/includes/actions/EditEntityActionTest.php
+++ b/repo/tests/phpunit/includes/actions/EditEntityActionTest.php
@@ -71,10 +71,11 @@
                        return;
                }
 
-               for ( $i = abs($ofs); $i > 0; $i -= 1 ) {
+               for ( $i = abs( $ofs ); $i > 0; $i -= 1 ) {
                        $rev = $rev->getPrevious();
                        if ( !$rev ) {
-                               throw new MWException( "Page " . 
$page->getTitle()->getPrefixedDBkey() . " does not have " . ( abs($ofs) +1 ) . 
" revisions" );
+                               throw new MWException( 'Page ' . 
$page->getTitle()->getPrefixedDBkey()
+                                       . ' does not have ' . ( abs( $ofs ) + 1 
) . ' revisions' );
                        }
                }
 
diff --git a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php 
b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
index 2e5ab08..a96f9fc 100644
--- a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
+++ b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
@@ -133,7 +133,7 @@
        public function testGetContentHandlerForType() {
                $factory = $this->newFactory();
 
-               foreach ( $factory->getEntityTypes() as $type  ) {
+               foreach ( $factory->getEntityTypes() as $type ) {
                        $model = $factory->getContentModelForType( $type );
                        $handler = $factory->getContentHandlerForType( $type );
 
diff --git a/repo/tests/phpunit/includes/content/EntityContentTest.php 
b/repo/tests/phpunit/includes/content/EntityContentTest.php
index 43dbd39..27caf7b 100644
--- a/repo/tests/phpunit/includes/content/EntityContentTest.php
+++ b/repo/tests/phpunit/includes/content/EntityContentTest.php
@@ -178,7 +178,7 @@
 
                foreach ( $expectedProps as $name => $expected ) {
                        $actual = $parserOutput->getProperty( $name );
-                       $this->assertEquals( $expected, $actual, "page property 
$name");
+                       $this->assertEquals( $expected, $actual, "page property 
$name" );
                }
        }
 
@@ -275,7 +275,7 @@
 
                return array(
                        'empty' => array( $empty, $empty, new 
EntityContentDiff( new EntityDiff(), new Diff() ) ),
-                       'same' => array( $ham, $ham, new EntityContentDiff(  
new EntityDiff(), new Diff()  ) ),
+                       'same' => array( $ham, $ham, new EntityContentDiff( new 
EntityDiff(), new Diff() ) ),
                        'spam to ham' => array( $spam, $ham, new 
EntityContentDiff( $spamToHamDiff, new Diff() ) ),
                );
        }
diff --git 
a/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutPageTest.php 
b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutPageTest.php
index 5ab432c..17d52eb 100644
--- a/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutPageTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutPageTest.php
@@ -32,7 +32,7 @@
                        ->will( $this->returnValue( array( 'acceptedlanguage' ) 
) );
                $termsLanguages->expects( $this->any() )
                        ->method( 'hasLanguage' )
-                       ->will( $this->returnCallback( function( $code) {
+                       ->will( $this->returnCallback( function( $code ) {
                                return $code === 'acceptedlanguage';
                        } ) );
 
@@ -64,7 +64,7 @@
                        ) );
 
                list( $output, ) = $this->executeSpecialPage( '' );
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
 
diff --git a/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php 
b/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
index e8eabc2..e987220 100644
--- a/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialGoToLinkedPageTest.php
@@ -139,7 +139,7 @@
                                'type' => 'submit',
                                'name' => 'submit',
                        ) );
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output for: ".$key );
                }
        }
diff --git a/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php 
b/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
index e218b2c..207a75a 100644
--- a/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
@@ -166,7 +166,7 @@
                        $this->assertEquals( $expected, $response->getheader( 
'Location' ), 'Redirect' );
                }
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
        }
diff --git 
a/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php 
b/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
index 72438ef..ef19310 100644
--- a/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialItemDisambiguationTest.php
@@ -30,7 +30,7 @@
        /**
         * @return ItemDisambiguation
         */
-       private function getMockItemDisambiguation( ) {
+       private function getMockItemDisambiguation() {
                $mock = $this->getMockBuilder( 'Wikibase\ItemDisambiguation' )
                        ->disableOriginalConstructor()
                        ->getMock();
@@ -150,7 +150,7 @@
                $request = new FauxRequest( $data );
 
                list( $output, ) = $this->executeSpecialPage( $sub, $request, 
$languageCode );
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
        }
diff --git a/repo/tests/phpunit/includes/specials/SpecialMergeItemsTest.php 
b/repo/tests/phpunit/includes/specials/SpecialMergeItemsTest.php
index 22dd128..1b9af47 100644
--- a/repo/tests/phpunit/includes/specials/SpecialMergeItemsTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialMergeItemsTest.php
@@ -173,7 +173,7 @@
 
                $this->assertNoError( $output );
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
        }
diff --git a/repo/tests/phpunit/includes/specials/SpecialModifyTermTestCase.php 
b/repo/tests/phpunit/includes/specials/SpecialModifyTermTestCase.php
index 068015f..aff2835 100644
--- a/repo/tests/phpunit/includes/specials/SpecialModifyTermTestCase.php
+++ b/repo/tests/phpunit/includes/specials/SpecialModifyTermTestCase.php
@@ -77,7 +77,7 @@
 
                // execute with no subpage value
                list( $output, ) = $this->executeSpecialPage( '', null, 'en' );
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}'" );
                }
 
@@ -101,7 +101,7 @@
                                'value' => 'remove',
                        ) );
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}' passing one subpage value" );
                }
 
@@ -110,7 +110,7 @@
                $matchers['language']['attributes']['value'] = 'de';
                $matchers['value']['attributes']['value'] = 'foo';
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}' passing two subpage values" );
                }
        }
diff --git a/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php 
b/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
index fe15e7c..828bad0 100644
--- a/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialNewItemTest.php
@@ -56,7 +56,7 @@
                        ) );
 
                list( $output, ) = $this->executeSpecialPage( '' );
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
 
@@ -64,7 +64,7 @@
                $matchers['label']['attributes']['value'] = 'LabelText';
                $matchers['description']['attributes']['value'] = 
'DescriptionText';
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
 
diff --git a/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php 
b/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
index 5e7346d..e0b72ff 100644
--- a/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialNewPropertyTest.php
@@ -55,7 +55,7 @@
                        ) );
 
                list( $output, ) = $this->executeSpecialPage( '' );
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
 
@@ -63,7 +63,7 @@
                $matchers['label']['attributes']['value'] = 'LabelText';
                $matchers['description']['attributes']['value'] = 
'DescriptionText';
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
        }
diff --git a/repo/tests/phpunit/includes/specials/SpecialRedirectEntityTest.php 
b/repo/tests/phpunit/includes/specials/SpecialRedirectEntityTest.php
index 99f2de0..7cf998f 100644
--- a/repo/tests/phpunit/includes/specials/SpecialRedirectEntityTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialRedirectEntityTest.php
@@ -175,7 +175,7 @@
 
                $this->assertNoError( $output );
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}''" );
                }
        }
diff --git 
a/repo/tests/phpunit/includes/specials/SpecialSetLabelDescriptionAliasesTest.php
 
b/repo/tests/phpunit/includes/specials/SpecialSetLabelDescriptionAliasesTest.php
index 6f804a5..698319f 100644
--- 
a/repo/tests/phpunit/includes/specials/SpecialSetLabelDescriptionAliasesTest.php
+++ 
b/repo/tests/phpunit/includes/specials/SpecialSetLabelDescriptionAliasesTest.php
@@ -61,7 +61,7 @@
                return $page;
        }
 
-       private function getMockEditFitlerHookRunner () {
+       private function getMockEditFitlerHookRunner() {
                $runner = $this->getMockBuilder( 
'Wikibase\Repo\Hooks\EditFilterHookRunner' )
                        ->setMethods( array( 'run' ) )
                        ->disableOriginalConstructor()
diff --git a/repo/tests/phpunit/includes/specials/SpecialSetSiteLinkTest.php 
b/repo/tests/phpunit/includes/specials/SpecialSetSiteLinkTest.php
index c68a8bf..a44b517 100644
--- a/repo/tests/phpunit/includes/specials/SpecialSetSiteLinkTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialSetSiteLinkTest.php
@@ -122,7 +122,7 @@
                $item->addSiteLink( new SiteLink( 'dewiki', 'Wikidata', array( 
$badge->getId() ) ) );
                $store->saveEntity( $item, "testing", $GLOBALS['wgUser'], 
EDIT_NEW );
 
-               $redirect = new EntityRedirect( new ItemId('Q12345678'), 
$item->getId() );
+               $redirect = new EntityRedirect( new ItemId( 'Q12345678' ), 
$item->getId() );
                $store->saveRedirect( $redirect, "testing", $GLOBALS['wgUser'], 
EDIT_NEW );
 
                self::$badgeId = $badge->getId()->getSerialization();
@@ -167,7 +167,7 @@
 
                $matchers['id']['attributes']['value'] = self::$itemId;
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}' passing one subpage value" );
                }
        }
@@ -206,7 +206,7 @@
 
                
$matchers['badges']['children']['only']['attributes']['selected'] = '';
 
-               foreach( $matchers as $key => $matcher ) {
+               foreach ( $matchers as $key => $matcher ) {
                        $this->assertTag( $matcher, $output, "Failed to match 
html output with tag '{$key}' passing two subpage values" );
                }
        }
@@ -263,7 +263,7 @@
                $this->assertContains( self::$itemId, $redirect, "Should 
redirect to item page" );
 
                /** @var Item $item */
-               $item = $lookup->getEntity( new ItemId( self::$itemId) );
+               $item = $lookup->getEntity( new ItemId( self::$itemId ) );
 
                $this->assertEquals(
                        'Wikipedia',
diff --git a/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php 
b/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
index de9ab86..ae51a1a 100644
--- a/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
+++ b/repo/tests/phpunit/includes/store/sql/DispatchStatsTest.php
@@ -275,7 +275,7 @@
         * @param int $expected
         */
        public function testGetClientCount( $expected ) {
-               $stats = $this->getDispatchStats( );
+               $stats = $this->getDispatchStats();
 
                $this->assertEquals( $expected, $stats->getClientCount() );
        }
diff --git a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php 
b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
index f0bb862..c4e91ec 100644
--- a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
+++ b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
@@ -106,7 +106,7 @@
 
                $store = WikibaseRepo::getDefaultInstance()->getEntityStore();
 
-               foreach( $labels as $label ) {
+               foreach ( $labels as $label ) {
                        $item = new Item();
                        $item->setLabel( 'en', $prefix . $label );
                        $rev = $store->saveEntity( $item, "added an item", 
$user, EDIT_NEW );
@@ -157,7 +157,7 @@
                        )
                );
 
-               foreach( $pageRow as $row ) {
+               foreach ( $pageRow as $row ) {
                        return (int)$row->page_id;
                }
 
@@ -250,7 +250,7 @@
        private function assertRows( $expectedRows ) {
                $dbw = wfGetDB( DB_MASTER );
 
-               foreach( $expectedRows as $expectedRow ) {
+               foreach ( $expectedRows as $expectedRow ) {
                        $pageId = (int)$expectedRow['epp_page_id'];
 
                        $resRowObject = $dbw->selectRow(
diff --git 
a/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php 
b/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
index 3d9ba36..ec0b124 100644
--- a/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
+++ b/repo/tests/phpunit/includes/store/sql/SqlChangeDispatchCoordinatorTest.php
@@ -55,13 +55,13 @@
                        return $wikiDB === 'zhwikidb';
                } );
 
-               $coordinator->setEngageClientLockOverride(  function( $wikiDB ) 
{
+               $coordinator->setEngageClientLockOverride( function( $wikiDB ) {
                        return $wikiDB !== 'zhwikidb';
-               }  );
+               } );
 
-               $coordinator->setReleaseClientLockOverride(  function( $wikiDB 
) {
+               $coordinator->setReleaseClientLockOverride( function( $wikiDB ) 
{
                        return true;
-               }  );
+               } );
 
                return $coordinator;
        }
diff --git 
a/repo/tests/phpunit/includes/store/sql/WikiPageEntityMetaDataLookupTest.php 
b/repo/tests/phpunit/includes/store/sql/WikiPageEntityMetaDataLookupTest.php
index 26123fc..6a8f152 100644
--- a/repo/tests/phpunit/includes/store/sql/WikiPageEntityMetaDataLookupTest.php
+++ b/repo/tests/phpunit/includes/store/sql/WikiPageEntityMetaDataLookupTest.php
@@ -113,7 +113,7 @@
                        ->loadRevisionInformation( $entityIds, DB_SLAVE );
 
                $serializedEntityIds = array();
-               foreach( $entityIds as $entityId ) {
+               foreach ( $entityIds as $entityId ) {
                        $serializedEntityIds[] = $entityId->getSerialization();
                }
 
diff --git a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php 
b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
index 9b91306..67edd2f 100644
--- a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
+++ b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
@@ -289,7 +289,7 @@
                /* @var EntityRevisionLookup $lookup */
                list( $store, $lookup ) = $this->createStoreAndLookup();
 
-               $anonUser = User::newFromId(0);
+               $anonUser = User::newFromId( 0 );
                $anonUser->setName( '127.0.0.1' );
                $user = User::newFromName( "EditEntityTestUser" );
                $item = new Item();
@@ -514,7 +514,7 @@
        /**
         * @dataProvider simpleEntityParameterProvider
         */
-       public function testDeleteEntity( Entity $entity  ) {
+       public function testDeleteEntity( Entity $entity ) {
                /* @var WikiPageEntityStore $store */
                /* @var EntityRevisionLookup $lookup */
                list( $store, $lookup ) = $this->createStoreAndLookup();
diff --git a/view/src/EntityTermsView.php b/view/src/EntityTermsView.php
index 4f79e6c..2a070ce 100644
--- a/view/src/EntityTermsView.php
+++ b/view/src/EntityTermsView.php
@@ -105,7 +105,7 @@
                $labels = $fingerprint->getLabels();
                $idInParentheses = '';
 
-               if( !is_null( $entityId ) ) {
+               if ( $entityId !== null ) {
                        $id = $entityId->getSerialization();
                        $idInParentheses = wfMessage( 'parentheses', $id 
)->text();
                }
@@ -179,7 +179,7 @@
        ) {
                $entityTermsForLanguageViewsHtml = '';
 
-               foreach( $languageCodes as $languageCode ) {
+               foreach ( $languageCodes as $languageCode ) {
                        $entityTermsForLanguageViewsHtml .= 
$this->getEntityTermsForLanguageView(
                                $fingerprint,
                                $languageCode,
@@ -220,7 +220,7 @@
                        'td',
                        $languageCode,
                        $this->templateFactory->render( 
'wikibase-entitytermsforlanguageview-language',
-                               is_null( $title )
+                               $title === null
                                        ? '#'
                                        : $title->getLocalURL( array( 'setlang' 
=> $languageCode ) ),
                                htmlspecialchars( 
$this->languageNameLookup->getName( $languageCode, $this->languageCode ) )
@@ -285,7 +285,7 @@
         * @return string
         */
        private function getHtmlForLabelDescriptionAliasesEditSection( EntityId 
$entityId = null ) {
-               if ( is_null( $this->sectionEditLinkGenerator ) ) {
+               if ( $this->sectionEditLinkGenerator === null ) {
                        return '';
                }
 
@@ -303,4 +303,5 @@
        private function msg( $key ) {
                return wfMessage( $key )->inLanguage( $this->languageCode );
        }
+
 }
diff --git a/view/src/SnakHtmlGenerator.php b/view/src/SnakHtmlGenerator.php
index 8492def..3abcc8f 100644
--- a/view/src/SnakHtmlGenerator.php
+++ b/view/src/SnakHtmlGenerator.php
@@ -144,7 +144,7 @@
         * @return string
         */
        private function getPropertyNotFoundMessage() {
-               return wfMessage ( 'wikibase-snakformat-propertynotfound' 
)->parse();
+               return wfMessage( 'wikibase-snakformat-propertynotfound' 
)->parse();
        }
 
 }
diff --git a/view/src/StatementGroupListView.php 
b/view/src/StatementGroupListView.php
index 1dfa40a..4c97289 100644
--- a/view/src/StatementGroupListView.php
+++ b/view/src/StatementGroupListView.php
@@ -142,7 +142,7 @@
        private function getHtmlForStatementListView( array $statements, 
$addStatementHtml ) {
                $statementViewsHtml = '';
 
-               foreach( $statements as $statement ) {
+               foreach ( $statements as $statement ) {
                        $statementViewsHtml .= 
$this->claimHtmlGenerator->getHtmlForClaim(
                                $statement,
                                
$this->editSectionGenerator->getStatementEditSection(
diff --git a/view/tests/phpunit/ItemViewTest.php 
b/view/tests/phpunit/ItemViewTest.php
index 12dcde3..9eb41cd 100644
--- a/view/tests/phpunit/ItemViewTest.php
+++ b/view/tests/phpunit/ItemViewTest.php
@@ -45,7 +45,7 @@
         * @return EntityId
         */
        protected function makeEntityId( $n ) {
-               return new ItemId( "Q$n");
+               return new ItemId( "Q$n" );
        }
 
        public function provideTestGetHtml() {
diff --git a/view/tests/phpunit/Template/TemplateRegistryTest.php 
b/view/tests/phpunit/Template/TemplateRegistryTest.php
index d78407a..793d318 100644
--- a/view/tests/phpunit/Template/TemplateRegistryTest.php
+++ b/view/tests/phpunit/Template/TemplateRegistryTest.php
@@ -44,7 +44,7 @@
                $registry->addTemplates( $data );
 
                $templates = $registry->getTemplates();
-               foreach( $data as $key => $html ) {
+               foreach ( $data as $key => $html ) {
                        $this->assertEquals(
                                $templates[$key],
                                $html

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5dcb7777c256dfd0891365150cc33a4cb3737d41
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to