Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Rename EntityIdTransformer and implementation for clarity
......................................................................

Rename EntityIdTransformer and implementation for clarity

Change-Id: I8061e6d0716bdf806995e3afb143f013af4502dc
---
M QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
M QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
M QueryEngine/includes/SQLStore/EntityInserter.php
M QueryEngine/includes/SQLStore/Factory.php
R QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
R QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
M QueryEngine/includes/SQLStore/SnakStore/SnakRowBuilder.php
M QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimInserterTest.php
M QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimRowBuilderTest.php
M QueryEngine/tests/phpunit/SQLStore/Engine/DescriptionMatchFinderTest.php
M QueryEngine/tests/phpunit/SQLStore/EntityInserterTest.php
R QueryEngine/tests/phpunit/SQLStore/SimpleEntityIdTransformerTest.php
M QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakInserterTest.php
M QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakRowBuilderTest.php
14 files changed, 31 insertions(+), 31 deletions(-)


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

diff --git a/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php 
b/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
index 9b01ad0..f266b40 100644
--- a/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
+++ b/QueryEngine/includes/SQLStore/ClaimStore/ClaimRowBuilder.php
@@ -4,7 +4,7 @@
 
 use Wikibase\Claim;
 use Wikibase\EntityId;
-use Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder;
+use Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer;
 use Wikibase\Statement;
 
 /**
@@ -37,7 +37,7 @@
 
        protected $idFinder;
 
-       public function __construct( InternalEntityIdFinder $idFinder ) {
+       public function __construct( InternalEntityIdTransformer $idFinder ) {
                $this->idFinder = $idFinder;
        }
 
diff --git a/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php 
b/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
index b91d52d..a4a2a49 100644
--- a/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
+++ b/QueryEngine/includes/SQLStore/Engine/DescriptionMatchFinder.php
@@ -11,7 +11,7 @@
 use Wikibase\Lib\EntityIdParser;
 use Wikibase\QueryEngine\QueryNotSupportedException;
 use Wikibase\QueryEngine\SQLStore\DataValueHandler;
-use Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder;
+use Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer;
 use Wikibase\QueryEngine\SQLStore\PropertyDataValueTypeLookup;
 use Wikibase\QueryEngine\SQLStore\Schema;
 use Wikibase\SnakRole;
@@ -52,7 +52,7 @@
        public function __construct( QueryInterface $queryInterface,
                        Schema $schema,
                        PropertyDataValueTypeLookup 
$propertyDataValueTypeLookup,
-                       InternalEntityIdFinder $idFinder ) {
+                       InternalEntityIdTransformer $idFinder ) {
                $this->queryInterface = $queryInterface;
                $this->schema = $schema;
                $this->propertyDataValueTypeLookup = 
$propertyDataValueTypeLookup;
diff --git a/QueryEngine/includes/SQLStore/EntityInserter.php 
b/QueryEngine/includes/SQLStore/EntityInserter.php
index fc5eae8..a9f6086 100644
--- a/QueryEngine/includes/SQLStore/EntityInserter.php
+++ b/QueryEngine/includes/SQLStore/EntityInserter.php
@@ -45,7 +45,7 @@
         * @param EntityTable $entityTable
         * @param ClaimInserter $claimInserter
         */
-       public function __construct( EntityTable $entityTable, ClaimInserter 
$claimInserter, InternalEntityIdFinder $idFinder ) {
+       public function __construct( EntityTable $entityTable, ClaimInserter 
$claimInserter, InternalEntityIdTransformer $idFinder ) {
                $this->entityTable = $entityTable;
                $this->claimInserter = $claimInserter;
                $this->idFinder = $idFinder;
diff --git a/QueryEngine/includes/SQLStore/Factory.php 
b/QueryEngine/includes/SQLStore/Factory.php
index c00562c..82ee3a2 100644
--- a/QueryEngine/includes/SQLStore/Factory.php
+++ b/QueryEngine/includes/SQLStore/Factory.php
@@ -74,7 +74,7 @@
                return new EntityInserter(
                        $this->newEntityTable(),
                        $this->newClaimInserter(),
-                       $this->getInternalEntityIdFinder()
+                       $this->getInternalEntityIdTransformer()
                );
        }
 
@@ -89,7 +89,7 @@
                return new ClaimInserter(
                        $this->newClaimsTable(),
                        $this->newSnakInserter(),
-                       new ClaimRowBuilder( $this->getInternalEntityIdFinder() 
)
+                       new ClaimRowBuilder( 
$this->getInternalEntityIdTransformer() )
                );
        }
 
@@ -103,7 +103,7 @@
        public function newSnakInserter() {
                return new SnakInserter(
                        $this->getSnakStores(),
-                       new SnakRowBuilder( $this->getInternalEntityIdFinder() )
+                       new SnakRowBuilder( 
$this->getInternalEntityIdTransformer() )
                );
        }
 
@@ -130,10 +130,10 @@
        }
 
        /**
-        * @return InternalEntityIdFinder
+        * @return InternalEntityIdTransformer
         */
-       protected function getInternalEntityIdFinder() {
-               return new EntityIdTransformer( 
$this->config->getEntityTypeMap() );
+       protected function getInternalEntityIdTransformer() {
+               return new SimpleEntityIdTransformer( 
$this->config->getEntityTypeMap() );
        }
 
        public function newWriter() {
@@ -150,7 +150,7 @@
                        $this->queryInterface,
                        $this->schema,
                        $this->config->getPropertyDataValueTypeLookup(),
-                       $this->getInternalEntityIdFinder()
+                       $this->getInternalEntityIdTransformer()
                );
        }
 
diff --git a/QueryEngine/includes/SQLStore/InternalEntityIdFinder.php 
b/QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
similarity index 96%
rename from QueryEngine/includes/SQLStore/InternalEntityIdFinder.php
rename to QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
index 83b6f01..ea721f5 100644
--- a/QueryEngine/includes/SQLStore/InternalEntityIdFinder.php
+++ b/QueryEngine/includes/SQLStore/InternalEntityIdTransformer.php
@@ -28,7 +28,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
-interface InternalEntityIdFinder {
+interface InternalEntityIdTransformer {
 
        /**
         * TODO: taking an EntityId would be a lot more convenient
diff --git a/QueryEngine/includes/SQLStore/EntityIdTransformer.php 
b/QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
similarity index 93%
rename from QueryEngine/includes/SQLStore/EntityIdTransformer.php
rename to QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
index dd019cb..bc0245a 100644
--- a/QueryEngine/includes/SQLStore/EntityIdTransformer.php
+++ b/QueryEngine/includes/SQLStore/SimpleEntityIdTransformer.php
@@ -29,7 +29,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Denny Vrandecic
  */
-class EntityIdTransformer implements InternalEntityIdFinder {
+class SimpleEntityIdTransformer implements InternalEntityIdTransformer {
 
        protected $idMap;
 
@@ -41,7 +41,7 @@
        }
 
        /**
-        * @see InternalEntityIdFinder::getInternalIdForEntity
+        * @see InternalEntityIdTransformer::getInternalIdForEntity
         *
         * @param string $entityType
         * @param int $entityNumber
diff --git a/QueryEngine/includes/SQLStore/SnakStore/SnakRowBuilder.php 
b/QueryEngine/includes/SQLStore/SnakStore/SnakRowBuilder.php
index a13d33d..9339d74 100644
--- a/QueryEngine/includes/SQLStore/SnakStore/SnakRowBuilder.php
+++ b/QueryEngine/includes/SQLStore/SnakStore/SnakRowBuilder.php
@@ -7,7 +7,7 @@
 use Wikibase\PropertyNoValueSnak;
 use Wikibase\PropertySomeValueSnak;
 use Wikibase\PropertyValueSnak;
-use Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder;
+use Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer;
 use Wikibase\Snak;
 
 /**
@@ -40,7 +40,7 @@
 
        protected $idFinder;
 
-       public function __construct( InternalEntityIdFinder $idFinder ) {
+       public function __construct( InternalEntityIdTransformer $idFinder ) {
                $this->idFinder = $idFinder;
        }
 
diff --git 
a/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimInserterTest.php 
b/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimInserterTest.php
index fc72714..24960d4 100644
--- a/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimInserterTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimInserterTest.php
@@ -104,7 +104,7 @@
 
                $snakInserter->expects( $this->exactly( $this->countClaimSnaks( 
$claim ) ) )->method( 'insertSnak' );
 
-               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder' );
+               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer' );
                $idFinder->expects( $this->any() )
                        ->method( 'getInternalIdForEntity' )
                        ->will( $this->returnValue( 42 ) );
diff --git 
a/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimRowBuilderTest.php 
b/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimRowBuilderTest.php
index 095d707..7378dae 100644
--- a/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimRowBuilderTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/ClaimStore/ClaimRowBuilderTest.php
@@ -74,7 +74,7 @@
         * @dataProvider claimProvider
         */
        public function testNewClaimRow( Claim $claim ) {
-               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder' );
+               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer' );
                $idFinder->expects( $this->any() )
                        ->method( 'getInternalIdForEntity' )
                        ->will( $this->returnValue( 42 ) );
diff --git 
a/QueryEngine/tests/phpunit/SQLStore/Engine/DescriptionMatchFinderTest.php 
b/QueryEngine/tests/phpunit/SQLStore/Engine/DescriptionMatchFinderTest.php
index 77518d1..e947f13 100644
--- a/QueryEngine/tests/phpunit/SQLStore/Engine/DescriptionMatchFinderTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/Engine/DescriptionMatchFinderTest.php
@@ -11,7 +11,7 @@
 use Wikibase\EntityId;
 use Wikibase\QueryEngine\SQLStore\DataValueTable;
 use Wikibase\QueryEngine\SQLStore\Engine\DescriptionMatchFinder;
-use Wikibase\QueryEngine\SQLStore\EntityIdTransformer;
+use Wikibase\QueryEngine\SQLStore\SimpleEntityIdTransformer;
 
 /**
  * @covers Wikibase\QueryEngine\SQLStore\Engine\DescriptionMatchFinder
@@ -55,7 +55,7 @@
                        $this->getMockBuilder( 
'Wikibase\QueryEngine\SQLStore\Schema' )
                                ->disableOriginalConstructor()->getMock(),
                        $this->getMock( 
'Wikibase\QueryEngine\SQLStore\PropertyDataValueTypeLookup' ),
-                       $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder' )
+                       $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer' )
                );
        }
 
@@ -101,7 +101,7 @@
 
                $dvTypeLookup = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\PropertyDataValueTypeLookup' );
 
-               $idTransformer = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder' );
+               $idTransformer = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer' );
 
                $matchFinder = new DescriptionMatchFinder(
                        $queryEngine,
diff --git a/QueryEngine/tests/phpunit/SQLStore/EntityInserterTest.php 
b/QueryEngine/tests/phpunit/SQLStore/EntityInserterTest.php
index df36c1b..c23b763 100644
--- a/QueryEngine/tests/phpunit/SQLStore/EntityInserterTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/EntityInserterTest.php
@@ -10,7 +10,7 @@
 use Wikibase\Property;
 use Wikibase\PropertyNoValueSnak;
 use Wikibase\QueryEngine\SQLStore\DataValueTable;
-use Wikibase\QueryEngine\SQLStore\EntityIdTransformer;
+use Wikibase\QueryEngine\SQLStore\SimpleEntityIdTransformer;
 use Wikibase\QueryEngine\SQLStore\EntityInserter;
 
 /**
@@ -74,7 +74,7 @@
                        );
                }
 
-               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder' );
+               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer' );
 
                $idFinder->expects( $this->any() )
                        ->method( 'getInternalIdForEntity' )
diff --git a/QueryEngine/tests/phpunit/SQLStore/EntityIdTransformerTest.php 
b/QueryEngine/tests/phpunit/SQLStore/SimpleEntityIdTransformerTest.php
similarity index 88%
rename from QueryEngine/tests/phpunit/SQLStore/EntityIdTransformerTest.php
rename to QueryEngine/tests/phpunit/SQLStore/SimpleEntityIdTransformerTest.php
index 12c420c..c1b7a6a 100644
--- a/QueryEngine/tests/phpunit/SQLStore/EntityIdTransformerTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/SimpleEntityIdTransformerTest.php
@@ -2,7 +2,7 @@
 
 namespace Wikibase\QueryEngine\Tests\SQLStore;
 
-use Wikibase\QueryEngine\SQLStore\EntityIdTransformer;
+use Wikibase\QueryEngine\SQLStore\SimpleEntityIdTransformer;
 
 /**
  * @covers Wikibase\QueryEngine\SQLStore\EntityIdTransformer
@@ -34,10 +34,10 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Denny Vrandecic
  */
-class EntityIdTransformerTest extends \PHPUnit_Framework_TestCase {
+class SimpleEntityIdTransformerTest extends \PHPUnit_Framework_TestCase {
 
        public function testConstruct() {
-               new EntityIdTransformer( $this->getIdMap() );
+               new SimpleEntityIdTransformer( $this->getIdMap() );
                $this->assertTrue( true );
        }
 
@@ -56,7 +56,7 @@
        public function testGetInternalIdForEntity( $entityType, $numericId ) {
                $idMap = $this->getIdMap();
 
-               $transformer = new EntityIdTransformer( $idMap );
+               $transformer = new SimpleEntityIdTransformer( $idMap );
 
                $internalId = $transformer->getInternalIdForEntity( 
$entityType, $numericId );
 
@@ -93,7 +93,7 @@
        public function testGetForNotSetType( $entityType, $numericId ) {
                $this->setExpectedException( 'OutOfBoundsException' );
 
-               $transformer = new EntityIdTransformer( array() );
+               $transformer = new SimpleEntityIdTransformer( array() );
 
                $transformer->getInternalIdForEntity( $entityType, $numericId );
        }
diff --git a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakInserterTest.php 
b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakInserterTest.php
index 2dab027..e92d32f 100644
--- a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakInserterTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakInserterTest.php
@@ -80,7 +80,7 @@
        }
 
        protected function newInstance( QueryInterface $queryInterface ) {
-               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder' );
+               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer' );
                $idFinder->expects( $this->any() )
                        ->method( 'getInternalIdForEntity' )
                        ->will( $this->returnValue( 42 ) );
diff --git 
a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakRowBuilderTest.php 
b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakRowBuilderTest.php
index 8fdcc7a..0271161 100644
--- a/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakRowBuilderTest.php
+++ b/QueryEngine/tests/phpunit/SQLStore/SnakStore/SnakRowBuilderTest.php
@@ -71,7 +71,7 @@
         * @dataProvider newSnakRowProvider
         */
        public function testNewSnakRow( Snak $snak, $snakRole ) {
-               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdFinder' );
+               $idFinder = $this->getMock( 
'Wikibase\QueryEngine\SQLStore\InternalEntityIdTransformer' );
                $idFinder->expects( $this->any() )
                        ->method( 'getInternalIdForEntity' )
                        ->will( $this->returnValue( 42 ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8061e6d0716bdf806995e3afb143f013af4502dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to