[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Remove unused methods from DumpMetaInformationLookup interface

2017-01-03 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/330211 )

Change subject: Remove unused methods from DumpMetaInformationLookup interface
..


Remove unused methods from DumpMetaInformationLookup interface

I believe we still want to keep this code in a shape that we can
continue working on it. This includes removing as much unneeded stuff
as possible.

I found this with a fulltext search for "fixme" and "todo". Note that
the implementation was incomplete.

Change-Id: I69b1b599b9d24fc775d848191f1ebd5aa7b7bc57
---
M includes/DumpMetaInformation/DumpMetaInformationLookup.php
M includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
M tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
3 files changed, 0 insertions(+), 75 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DumpMetaInformation/DumpMetaInformationLookup.php 
b/includes/DumpMetaInformation/DumpMetaInformationLookup.php
index a964ef2..ad07288 100644
--- a/includes/DumpMetaInformation/DumpMetaInformationLookup.php
+++ b/includes/DumpMetaInformation/DumpMetaInformationLookup.php
@@ -2,7 +2,6 @@
 
 namespace WikibaseQuality\ExternalValidation\DumpMetaInformation;
 
-use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\PropertyId;
 
 /**
@@ -12,15 +11,6 @@
  * @license GNU GPL v2+
  */
 interface DumpMetaInformationLookup {
-
-   /**
-* Gets DumpMetaInformation for specific dump id from database.
-*
-* @param $dumpId
-* @return DumpMetaInformation
-* @throws \InvalidArgumentException
-*/
-   public function getWithId( $dumpId );
 
/**
 * Gets DumpMetaInformation for specific dump ids from database
@@ -41,13 +31,6 @@
 * @return DumpMetaInformation[]
 */
public function getWithIdentifierProperties( array 
$identifierPropertyIds );
-
-   /**
-* Gets id of item that represents the data source for each dump.
-*
-* @return ItemId[]
-*/
-   public function getSourceItemIds();
 
/**
 * Gets all DumpMetaInformation from database
diff --git a/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php 
b/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
index 1623537..0371b82 100644
--- a/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
+++ b/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
@@ -22,23 +22,6 @@
const IDENTIFIER_PROPERTIES_TABLE_NAME = 'wbqev_identifier_properties';
 
/**
-* Gets DumpMetaInformation for specific dump id from database.
-*
-* @param $dumpId
-* @return DumpMetaInformation
-* @throws InvalidArgumentException
-*/
-   public function getWithId( $dumpId ) {
-   if ( !is_string( $dumpId ) ) {
-   throw new InvalidArgumentException( '$dumpId must be 
string.' );
-   }
-
-   $dumpMetaInformation = $this->getWithIds( array( $dumpId ) );
-
-   return reset( $dumpMetaInformation );
-   }
-
-   /**
 * Gets DumpMetaInformation for specific dump ids from database
 * Returns array in the form 'dumpId' => DumpMetaInformation
 *
@@ -122,30 +105,6 @@
}
 
return array();
-   }
-
-   /**
-* Gets id of item that represents the data source for each dump.
-*
-* @return ItemId[]
-*/
-   public function getSourceItemIds() {
-   $db = wfGetDB( DB_SLAVE );
-   $result = $db->selectFieldValues(
-   self::META_TABLE_NAME,
-   'source_qid',
-   array(),
-   __METHOD__,
-   'DISTINCT'
-   );
-
-   $sourceItemIds = $result; // TODO: Parse as ItemId, when 
ItemIds are used in violation table
-   /*$sourceItemIds = array();
-   foreach ( $result as $itemId ) {
-   $sourceItemIds = new ItemId( $itemId );
-   }*/
-
-   return $sourceItemIds;
}
 
/**
diff --git 
a/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php 
b/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
index ca3ec05..d0d661c 100644
--- a/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
+++ b/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
@@ -130,17 +130,6 @@
}
 
/**
-* @dataProvider getWithIdDataProvider
-*/
-   public function testGetWithId( $dumpId, $expectedDumpMetaInformation, 
$expectedException = null ) {
-   $this->setExpectedException( $expectedException );
-
-   $dumpMetaInformation = 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Remove unused methods from DumpMetaInformationLookup interface

2017-01-03 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/330211 )

Change subject: Remove unused methods from DumpMetaInformationLookup interface
..

Remove unused methods from DumpMetaInformationLookup interface

I believe we still want to keep this code in a shape that we can
continue working on it. This includes removing as much unneeded stuff
as possible.

I found this with a fulltext search for "fixme" and "todo". Note that
the implementation was incomplete.

Change-Id: I69b1b599b9d24fc775d848191f1ebd5aa7b7bc57
---
M includes/DumpMetaInformation/DumpMetaInformationLookup.php
M includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
M tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
3 files changed, 0 insertions(+), 75 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation
 refs/changes/11/330211/1

diff --git a/includes/DumpMetaInformation/DumpMetaInformationLookup.php 
b/includes/DumpMetaInformation/DumpMetaInformationLookup.php
index a964ef2..ad07288 100644
--- a/includes/DumpMetaInformation/DumpMetaInformationLookup.php
+++ b/includes/DumpMetaInformation/DumpMetaInformationLookup.php
@@ -2,7 +2,6 @@
 
 namespace WikibaseQuality\ExternalValidation\DumpMetaInformation;
 
-use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\PropertyId;
 
 /**
@@ -12,15 +11,6 @@
  * @license GNU GPL v2+
  */
 interface DumpMetaInformationLookup {
-
-   /**
-* Gets DumpMetaInformation for specific dump id from database.
-*
-* @param $dumpId
-* @return DumpMetaInformation
-* @throws \InvalidArgumentException
-*/
-   public function getWithId( $dumpId );
 
/**
 * Gets DumpMetaInformation for specific dump ids from database
@@ -41,13 +31,6 @@
 * @return DumpMetaInformation[]
 */
public function getWithIdentifierProperties( array 
$identifierPropertyIds );
-
-   /**
-* Gets id of item that represents the data source for each dump.
-*
-* @return ItemId[]
-*/
-   public function getSourceItemIds();
 
/**
 * Gets all DumpMetaInformation from database
diff --git a/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php 
b/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
index 1623537..0371b82 100644
--- a/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
+++ b/includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
@@ -22,23 +22,6 @@
const IDENTIFIER_PROPERTIES_TABLE_NAME = 'wbqev_identifier_properties';
 
/**
-* Gets DumpMetaInformation for specific dump id from database.
-*
-* @param $dumpId
-* @return DumpMetaInformation
-* @throws InvalidArgumentException
-*/
-   public function getWithId( $dumpId ) {
-   if ( !is_string( $dumpId ) ) {
-   throw new InvalidArgumentException( '$dumpId must be 
string.' );
-   }
-
-   $dumpMetaInformation = $this->getWithIds( array( $dumpId ) );
-
-   return reset( $dumpMetaInformation );
-   }
-
-   /**
 * Gets DumpMetaInformation for specific dump ids from database
 * Returns array in the form 'dumpId' => DumpMetaInformation
 *
@@ -122,30 +105,6 @@
}
 
return array();
-   }
-
-   /**
-* Gets id of item that represents the data source for each dump.
-*
-* @return ItemId[]
-*/
-   public function getSourceItemIds() {
-   $db = wfGetDB( DB_SLAVE );
-   $result = $db->selectFieldValues(
-   self::META_TABLE_NAME,
-   'source_qid',
-   array(),
-   __METHOD__,
-   'DISTINCT'
-   );
-
-   $sourceItemIds = $result; // TODO: Parse as ItemId, when 
ItemIds are used in violation table
-   /*$sourceItemIds = array();
-   foreach ( $result as $itemId ) {
-   $sourceItemIds = new ItemId( $itemId );
-   }*/
-
-   return $sourceItemIds;
}
 
/**
diff --git 
a/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php 
b/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
index ca3ec05..d0d661c 100644
--- a/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
+++ b/tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
@@ -130,17 +130,6 @@
}
 
/**
-* @dataProvider getWithIdDataProvider
-*/
-   public function testGetWithId( $dumpId, $expectedDumpMetaInformation, 
$expectedException = null ) {
-   $this->setExpectedException( $expectedException );
-
-