[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: Ic4e3e780fe3f9ef1ff548f7f89f714454480b7b3
---
M repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
M repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
M repo/tests/phpunit/includes/content/EntityHandlerTest.php
3 files changed, 11 insertions(+), 19 deletions(-)


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

diff --git 
a/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php 
b/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
index b5a096f..499caef 100644
--- a/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
@@ -29,7 +29,7 @@
}
 
public function testNewRemoveSiteLinkOp() {
-   $op = $this->newChangeOpFactory()->newRemoveSiteLinkOp( 
'enwiki', 'Foo' );
+   $op = $this->newChangeOpFactory()->newRemoveSiteLinkOp( 
'enwiki' );
$this->assertInstanceOf( 'Wikibase\ChangeOp\ChangeOp', $op );
}
 
diff --git a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php 
b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
index 57bb127..20c83ab 100644
--- a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
@@ -275,23 +275,23 @@
 
public function provideValidateDataValue() {
return array(
-   array( new StringValue( '123' ), 'numeric', 'p1', 
'valid numeric value', true ),
-   array( new StringValue( '123' ), 'alphabetic', 'p2', 
'invalid alphabetic value', false ),
-   array( new StringValue( 'abc' ), 'alphabetic', 'p2', 
'valid alphabetic value', true ),
-   array( new StringValue( 'abc' ), 'numeric', 'p1', 
'invalid numeric value', false ),
-   array( new StringValue( '01234567890123456789' ), 
'numeric', 'p1', 'overly long numeric value', false ),
-   array( new UnknownValue( 'abc' ), 'alphabetic', 'p2', 
'bad value type', false ),
-   array( new UnDeserializableValue( 'abc', 'string', 
'error' ), 'numeric', 'p1', 'bad value', false ),
+   array( new StringValue( '123' ), 'numeric', 'valid 
numeric value', true ),
+   array( new StringValue( '123' ), 'alphabetic', 'invalid 
alphabetic value', false ),
+   array( new StringValue( 'abc' ), 'alphabetic', 'valid 
alphabetic value', true ),
+   array( new StringValue( 'abc' ), 'numeric', 'invalid 
numeric value', false ),
+   array( new StringValue( '01234567890123456789' ), 
'numeric', 'overly long numeric value', false ),
+   array( new UnknownValue( 'abc' ), 'alphabetic', 'bad 
value type', false ),
+   array( new UnDeserializableValue( 'abc', 'string', 
'error' ), 'numeric', 'bad value', false ),
);
}
 
/**
 * @dataProvider provideValidateDataValue
 */
-   public function testValidateDataValue( DataValue $dataValue, 
$dataTypeId, $propertyName, $description, $expectedValid = true ) {
+   public function testValidateDataValue( DataValue $dataValue, 
$dataTypeId, $description, $expectedValid = true ) {
$validator = $this->getSnakValidator();
 
-   $result = $validator->validateDataValue( $dataValue, 
$dataTypeId, $propertyName );
+   $result = $validator->validateDataValue( $dataValue, 
$dataTypeId );
 
$this->assertEquals( $expectedValid, $result->isValid(), 
$description );
}
diff --git a/repo/tests/phpunit/includes/content/EntityHandlerTest.php 
b/repo/tests/phpunit/includes/content/EntityHandlerTest.php
index 15b5d3a..2fac6a4 100644
--- a/repo/tests/phpunit/includes/content/EntityHandlerTest.php
+++ b/repo/tests/phpunit/includes/content/EntityHandlerTest.php
@@ -408,14 +408,6 @@
}
 
public function testExportTransform_neverRecodeNonLegacyFormat() {
-   $codec = $this->getMockBuilder( 
'Wikibase\Lib\Store\EntityContentDataCodec' )
-   ->disableOriginalConstructor()
-   ->getMock();
-   $codec->expects( $this->never() )
-   ->method( 'decodeEntity' );
-   $codec->expects( $this->never() )
-   ->method( 'encodeEntity' );
-
$settings = new SettingsArray();
$settings->setSetting( 'transformLegacyFormatOnExport', true );
 
@@ -423,7 +415,7 @@
$currentSerializer = $this->getWikibaseRepo( 

[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Dead since 7e9afb6598acde776796639e9ca2102d0ff8860e

Change-Id: Ic0beb0f90446a7dc81c1e915c29800929f42a800
---
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
1 file changed, 0 insertions(+), 38 deletions(-)


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

diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php 
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
index f5f3dbc..50d72d7 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
@@ -50,24 +50,6 @@
}
 
/**
-* @param EntityUsage[] $usages
-*
-* @return array
-*/
-   private function getItemIds( array $usages ) {
-   $ids = array();
-
-   foreach ( $usages as $usage ) {
-   $id = $usage->getEntityId();
-
-   $key = $id->getSerialization();
-   $ids[$key] = $id;
-   }
-
-   return $ids;
-   }
-
-   /**
 * @param int $pageId
 * @param EntityUsage[] $usages
 * @param string $touched timestamp
@@ -96,26 +78,6 @@
}
 
$rows[$key] = $row;
-   }
-
-   return $rows;
-   }
-
-   /**
-* @param array[] $rows
-* @param EntityId[] $entityIds
-*
-* @return array[]
-*/
-   private function removeRowsForEntities( array $rows, array $entityIds ) 
{
-   $idStrings = array_map( function ( EntityId $id ) {
-   return $id->getSerialization();
-   }, $entityIds );
-
-   foreach ( $rows as $key => $row ) {
-   if ( in_array( $row['eu_entity_id'], $idStrings ) ) {
-   unset( $rows[$key] );
-   }
}
 
return $rows;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0beb0f90446a7dc81c1e915c29800929f42a800
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-11-03 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Dead since 7e9afb6598acde776796639e9ca2102d0ff8860e

Change-Id: Ic0beb0f90446a7dc81c1e915c29800929f42a800
---
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
1 file changed, 0 insertions(+), 38 deletions(-)

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



diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php 
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
index f5f3dbc..50d72d7 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
@@ -50,24 +50,6 @@
}
 
/**
-* @param EntityUsage[] $usages
-*
-* @return array
-*/
-   private function getItemIds( array $usages ) {
-   $ids = array();
-
-   foreach ( $usages as $usage ) {
-   $id = $usage->getEntityId();
-
-   $key = $id->getSerialization();
-   $ids[$key] = $id;
-   }
-
-   return $ids;
-   }
-
-   /**
 * @param int $pageId
 * @param EntityUsage[] $usages
 * @param string $touched timestamp
@@ -96,26 +78,6 @@
}
 
$rows[$key] = $row;
-   }
-
-   return $rows;
-   }
-
-   /**
-* @param array[] $rows
-* @param EntityId[] $entityIds
-*
-* @return array[]
-*/
-   private function removeRowsForEntities( array $rows, array $entityIds ) 
{
-   $idStrings = array_map( function ( EntityId $id ) {
-   return $id->getSerialization();
-   }, $entityIds );
-
-   foreach ( $rows as $key => $row ) {
-   if ( in_array( $row['eu_entity_id'], $idStrings ) ) {
-   unset( $rows[$key] );
-   }
}
 
return $rows;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic0beb0f90446a7dc81c1e915c29800929f42a800
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-11-03 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: Ic4e3e780fe3f9ef1ff548f7f89f714454480b7b3
---
M repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
M repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
M repo/tests/phpunit/includes/content/EntityHandlerTest.php
3 files changed, 11 insertions(+), 19 deletions(-)

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



diff --git 
a/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php 
b/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
index b5a096f..499caef 100644
--- a/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
@@ -29,7 +29,7 @@
}
 
public function testNewRemoveSiteLinkOp() {
-   $op = $this->newChangeOpFactory()->newRemoveSiteLinkOp( 
'enwiki', 'Foo' );
+   $op = $this->newChangeOpFactory()->newRemoveSiteLinkOp( 
'enwiki' );
$this->assertInstanceOf( 'Wikibase\ChangeOp\ChangeOp', $op );
}
 
diff --git a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php 
b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
index 57bb127..20c83ab 100644
--- a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
@@ -275,23 +275,23 @@
 
public function provideValidateDataValue() {
return array(
-   array( new StringValue( '123' ), 'numeric', 'p1', 
'valid numeric value', true ),
-   array( new StringValue( '123' ), 'alphabetic', 'p2', 
'invalid alphabetic value', false ),
-   array( new StringValue( 'abc' ), 'alphabetic', 'p2', 
'valid alphabetic value', true ),
-   array( new StringValue( 'abc' ), 'numeric', 'p1', 
'invalid numeric value', false ),
-   array( new StringValue( '01234567890123456789' ), 
'numeric', 'p1', 'overly long numeric value', false ),
-   array( new UnknownValue( 'abc' ), 'alphabetic', 'p2', 
'bad value type', false ),
-   array( new UnDeserializableValue( 'abc', 'string', 
'error' ), 'numeric', 'p1', 'bad value', false ),
+   array( new StringValue( '123' ), 'numeric', 'valid 
numeric value', true ),
+   array( new StringValue( '123' ), 'alphabetic', 'invalid 
alphabetic value', false ),
+   array( new StringValue( 'abc' ), 'alphabetic', 'valid 
alphabetic value', true ),
+   array( new StringValue( 'abc' ), 'numeric', 'invalid 
numeric value', false ),
+   array( new StringValue( '01234567890123456789' ), 
'numeric', 'overly long numeric value', false ),
+   array( new UnknownValue( 'abc' ), 'alphabetic', 'bad 
value type', false ),
+   array( new UnDeserializableValue( 'abc', 'string', 
'error' ), 'numeric', 'bad value', false ),
);
}
 
/**
 * @dataProvider provideValidateDataValue
 */
-   public function testValidateDataValue( DataValue $dataValue, 
$dataTypeId, $propertyName, $description, $expectedValid = true ) {
+   public function testValidateDataValue( DataValue $dataValue, 
$dataTypeId, $description, $expectedValid = true ) {
$validator = $this->getSnakValidator();
 
-   $result = $validator->validateDataValue( $dataValue, 
$dataTypeId, $propertyName );
+   $result = $validator->validateDataValue( $dataValue, 
$dataTypeId );
 
$this->assertEquals( $expectedValid, $result->isValid(), 
$description );
}
diff --git a/repo/tests/phpunit/includes/content/EntityHandlerTest.php 
b/repo/tests/phpunit/includes/content/EntityHandlerTest.php
index 15b5d3a..2fac6a4 100644
--- a/repo/tests/phpunit/includes/content/EntityHandlerTest.php
+++ b/repo/tests/phpunit/includes/content/EntityHandlerTest.php
@@ -408,14 +408,6 @@
}
 
public function testExportTransform_neverRecodeNonLegacyFormat() {
-   $codec = $this->getMockBuilder( 
'Wikibase\Lib\Store\EntityContentDataCodec' )
-   ->disableOriginalConstructor()
-   ->getMock();
-   $codec->expects( $this->never() )
-   ->method( 'decodeEntity' );
-   $codec->expects( $this->never() )
-   ->method( 'encodeEntity' );
-
$settings = new SettingsArray();
$settings->setSetting( 'transformLegacyFormatOnExport', true );
 
@@ -423,7 +415,7 @@
$currentSerializer = $this->getWikibaseRepo( $settings 
)->getInternalEntitySerializer();

[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-09-16 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: If8e91a7cae2575c0b5401ac9a50e4dd1b8c05429
---
D repo/includes/ExceptionWithCode.php
1 file changed, 0 insertions(+), 40 deletions(-)


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

diff --git a/repo/includes/ExceptionWithCode.php 
b/repo/includes/ExceptionWithCode.php
deleted file mode 100644
index c6d4f5b..000
--- a/repo/includes/ExceptionWithCode.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- */
-class ExceptionWithCode extends \Exception {
-
-   /**
-* @var string
-*/
-   private $stringCode;
-
-   /**
-* @since 0.4
-*
-* @param string $message
-* @param string $code
-*/
-   public function __construct( $message, $code ) {
-   parent::__construct( $message );
-   $this->stringCode = $code;
-   }
-
-   /**
-* @since 0.4
-*
-* @return string
-*/
-   public function getErrorCode() {
-   return $this->stringCode;
-   }
-
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8e91a7cae2575c0b5401ac9a50e4dd1b8c05429
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: If8e91a7cae2575c0b5401ac9a50e4dd1b8c05429
---
D repo/includes/ExceptionWithCode.php
1 file changed, 0 insertions(+), 40 deletions(-)

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



diff --git a/repo/includes/ExceptionWithCode.php 
b/repo/includes/ExceptionWithCode.php
deleted file mode 100644
index c6d4f5b..000
--- a/repo/includes/ExceptionWithCode.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- */
-class ExceptionWithCode extends \Exception {
-
-   /**
-* @var string
-*/
-   private $stringCode;
-
-   /**
-* @since 0.4
-*
-* @param string $message
-* @param string $code
-*/
-   public function __construct( $message, $code ) {
-   parent::__construct( $message );
-   $this->stringCode = $code;
-   }
-
-   /**
-* @since 0.4
-*
-* @return string
-*/
-   public function getErrorCode() {
-   return $this->stringCode;
-   }
-
-}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If8e91a7cae2575c0b5401ac9a50e4dd1b8c05429
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-09-06 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: If7feeeb6825fa79efe3ccead5d66f253c7ad5083
---
M repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
1 file changed, 0 insertions(+), 6 deletions(-)

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



diff --git a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php 
b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
index 7f46c4a..c27b679 100644
--- a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
+++ b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
@@ -42,12 +42,6 @@
 */
private $entityIdParser;
 
-   private function newEntityPerPageTable() {
-   $idParser = $this->getEntityIdParser();
-   $useRedirectTargetColumn = 
WikibaseRepo::getDefaultInstance()->getSettings()->getSetting( 
'useRedirectTargetColumn' );
-   return new EntityPerPageTable( $idParser, 
$useRedirectTargetColumn );
-   }
-
/**
 * @see EntityLookupTest::newEntityLoader()
 *

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If7feeeb6825fa79efe3ccead5d66f253c7ad5083
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-09-05 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: If7feeeb6825fa79efe3ccead5d66f253c7ad5083
---
M repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
1 file changed, 0 insertions(+), 6 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php 
b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
index 7f46c4a..c27b679 100644
--- a/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
+++ b/repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
@@ -42,12 +42,6 @@
 */
private $entityIdParser;
 
-   private function newEntityPerPageTable() {
-   $idParser = $this->getEntityIdParser();
-   $useRedirectTargetColumn = 
WikibaseRepo::getDefaultInstance()->getSettings()->getSetting( 
'useRedirectTargetColumn' );
-   return new EntityPerPageTable( $idParser, 
$useRedirectTargetColumn );
-   }
-
/**
 * @see EntityLookupTest::newEntityLoader()
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7feeeb6825fa79efe3ccead5d66f253c7ad5083
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-08-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: I6da1359b5a86fcbb732112016cae7e8847a5f04c
---
M repo/includes/ChangeOp/ChangeOpDescription.php
M repo/includes/Validators/TermValidatorFactory.php
M repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
3 files changed, 3 insertions(+), 5 deletions(-)


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

diff --git a/repo/includes/ChangeOp/ChangeOpDescription.php 
b/repo/includes/ChangeOp/ChangeOpDescription.php
index eaf0643..65f2f91 100644
--- a/repo/includes/ChangeOp/ChangeOpDescription.php
+++ b/repo/includes/ChangeOp/ChangeOpDescription.php
@@ -107,7 +107,7 @@
 */
public function validate( Entity $entity ) {
$languageValidator = 
$this-termValidatorFactory-getLanguageValidator();
-   $termValidator = 
$this-termValidatorFactory-getDescriptionValidator( $entity-getType() );
+   $termValidator = 
$this-termValidatorFactory-getDescriptionValidator();
$fingerprintValidator = 
$this-termValidatorFactory-getFingerprintValidator( $entity-getType() );
 
// check that the language is valid
diff --git a/repo/includes/Validators/TermValidatorFactory.php 
b/repo/includes/Validators/TermValidatorFactory.php
index fd8ad5d..8b21569 100644
--- a/repo/includes/Validators/TermValidatorFactory.php
+++ b/repo/includes/Validators/TermValidatorFactory.php
@@ -104,11 +104,9 @@
}
 
/**
-* @param string $entityType
-*
 * @return ValueValidator
 */
-   public function getDescriptionValidator( $entityType ) {
+   public function getDescriptionValidator() {
$validators = $this-getCommonTermValidators();
 
return new CompositeValidator( $validators, true );
diff --git 
a/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php 
b/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
index b09b74a..84d2e16 100644
--- a/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
+++ b/repo/tests/phpunit/includes/Validators/TermValidatorFactoryTest.php
@@ -114,7 +114,7 @@
public function testGetDescriptionValidator() {
$builders = $this-newFactory( 8, array( 'en' ) );
 
-   $validator = $builders-getDescriptionValidator( 
Item::ENTITY_TYPE );
+   $validator = $builders-getDescriptionValidator();
 
$this-assertInstanceOf( 'ValueValidators\ValueValidator', 
$validator );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6da1359b5a86fcbb732112016cae7e8847a5f04c
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-08-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: I567da42fd1a83f8a085db8c98d13d256acbbf05b
---
M lib/includes/formatters/WikibaseSnakFormatterBuilders.php
M lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php
2 files changed, 1 insertion(+), 8 deletions(-)


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

diff --git a/lib/includes/formatters/WikibaseSnakFormatterBuilders.php 
b/lib/includes/formatters/WikibaseSnakFormatterBuilders.php
index 9b9ddeb..8c1e2fe 100644
--- a/lib/includes/formatters/WikibaseSnakFormatterBuilders.php
+++ b/lib/includes/formatters/WikibaseSnakFormatterBuilders.php
@@ -71,17 +71,12 @@
 * Returns a DispatchingSnakFormatter for the given format, that will 
dispatch based on
 * the snak type. The instance returned by this method will cover all 
standard snak types.
 *
-* @param OutputFormatSnakFormatterFactory $factory
 * @param string   $format
 * @param FormatterOptions $options
 *
 * @return DispatchingSnakFormatter
 */
-   public function buildDispatchingSnakFormatter(
-   OutputFormatSnakFormatterFactory $factory,
-   $format,
-   FormatterOptions $options
-   ) {
+   public function buildDispatchingSnakFormatter( $format, 
FormatterOptions $options ) {
$this-valueFormatterBuilders-applyLanguageDefaults( $options 
);
$lang = $options-getOption( ValueFormatter::OPT_LANG );
 
diff --git a/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php 
b/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php
index f76840a..1a479ec 100644
--- a/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php
+++ b/lib/tests/phpunit/formatters/WikibaseSnakFormatterBuildersTest.php
@@ -101,10 +101,8 @@
 */
public function testBuildDispatchingSnakFormatter( $format, $options, 
$type, $snak, $expected ) {
$builders = $this-newBuilders( $type, new ItemId( 'Q5' ) );
-   $factory = new OutputFormatSnakFormatterFactory( 
$builders-getSnakFormatterBuildersForFormats() );
 
$formatter = $builders-buildDispatchingSnakFormatter(
-   $factory,
$format,
$options
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I567da42fd1a83f8a085db8c98d13d256acbbf05b
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-06-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: I0ea2e8a6880022cf1b33c2ad20ec5478dace7ced
---
M purtle/src/N3RdfWriterBase.php
1 file changed, 0 insertions(+), 21 deletions(-)

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



diff --git a/purtle/src/N3RdfWriterBase.php b/purtle/src/N3RdfWriterBase.php
index ea405d7..23aa8b4 100644
--- a/purtle/src/N3RdfWriterBase.php
+++ b/purtle/src/N3RdfWriterBase.php
@@ -2,8 +2,6 @@
 
 namespace Wikimedia\Purtle;
 
-use InvalidArgumentException;
-
 /**
  * Base class for RdfWriter implementations that output an N3 dialect.
  *
@@ -36,21 +34,10 @@
}
 
protected function writeShorthand( $shorthand ) {
-// if ( $shorthand === null || $shorthand === '' ) {
-// throw new InvalidArgumentException( '$shorthand must 
not be empty' );
-// }
-
$this-write( $shorthand );
}
 
protected function writeIRI( $iri, $trustIRI = false ) {
-// if ( $iri === null || $iri === '' ) {
-// throw new InvalidArgumentException( '$iri must not be 
empty' );
-// }
-
-// if ( $iri[0] === '_' || $iri[0] === ':' || $iri[0] === '/' || 
$iri[0] === '#' ) {
-// throw new InvalidArgumentException( '$iri must be an 
absolute iri: ' . $iri );
-// }
if ( !$trustIRI ) {
$iri = $this-quoter-escapeIRI( $iri );
}
@@ -58,14 +45,6 @@
}
 
protected function writeQName( $base, $local ) {
-// if ( $base === null ) {
-// throw new InvalidArgumentException( '$base must not be 
null' );
-// }
-
-// if ( $local === null || $local === '' ) {
-// throw new InvalidArgumentException( '$local must not be 
empty' );
-// }
-
$this-write( $base:$local );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ea2e8a6880022cf1b33c2ad20ec5478dace7ced
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-06-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: Ie01f822d5320009c0aa9bed11c8dd28426c1f7cb
---
M repo/includes/store/sql/SqlStore.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/repo/includes/store/sql/SqlStore.php 
b/repo/includes/store/sql/SqlStore.php
index 6162f66..f216df3 100644
--- a/repo/includes/store/sql/SqlStore.php
+++ b/repo/includes/store/sql/SqlStore.php
@@ -680,7 +680,6 @@
 * @return PropertyInfoStore
 */
private function newPropertyInfoStore() {
-   $wikibaseRepo = WikibaseRepo::getDefaultInstance();
$table = new PropertyInfoTable( false );
$cacheKey = $this-cacheKeyPrefix . ':CachingPropertyInfoStore';
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie01f822d5320009c0aa9bed11c8dd28426c1f7cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-06-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: I0ea2e8a6880022cf1b33c2ad20ec5478dace7ced
---
M purtle/src/N3RdfWriterBase.php
1 file changed, 0 insertions(+), 21 deletions(-)


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

diff --git a/purtle/src/N3RdfWriterBase.php b/purtle/src/N3RdfWriterBase.php
index ea405d7..23aa8b4 100644
--- a/purtle/src/N3RdfWriterBase.php
+++ b/purtle/src/N3RdfWriterBase.php
@@ -2,8 +2,6 @@
 
 namespace Wikimedia\Purtle;
 
-use InvalidArgumentException;
-
 /**
  * Base class for RdfWriter implementations that output an N3 dialect.
  *
@@ -36,21 +34,10 @@
}
 
protected function writeShorthand( $shorthand ) {
-// if ( $shorthand === null || $shorthand === '' ) {
-// throw new InvalidArgumentException( '$shorthand must 
not be empty' );
-// }
-
$this-write( $shorthand );
}
 
protected function writeIRI( $iri, $trustIRI = false ) {
-// if ( $iri === null || $iri === '' ) {
-// throw new InvalidArgumentException( '$iri must not be 
empty' );
-// }
-
-// if ( $iri[0] === '_' || $iri[0] === ':' || $iri[0] === '/' || 
$iri[0] === '#' ) {
-// throw new InvalidArgumentException( '$iri must be an 
absolute iri: ' . $iri );
-// }
if ( !$trustIRI ) {
$iri = $this-quoter-escapeIRI( $iri );
}
@@ -58,14 +45,6 @@
}
 
protected function writeQName( $base, $local ) {
-// if ( $base === null ) {
-// throw new InvalidArgumentException( '$base must not be 
null' );
-// }
-
-// if ( $local === null || $local === '' ) {
-// throw new InvalidArgumentException( '$local must not be 
empty' );
-// }
-
$this-write( $base:$local );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ea2e8a6880022cf1b33c2ad20ec5478dace7ced
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-06-22 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: Ie01f822d5320009c0aa9bed11c8dd28426c1f7cb
---
M repo/includes/store/sql/SqlStore.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/repo/includes/store/sql/SqlStore.php 
b/repo/includes/store/sql/SqlStore.php
index 6162f66..f216df3 100644
--- a/repo/includes/store/sql/SqlStore.php
+++ b/repo/includes/store/sql/SqlStore.php
@@ -680,7 +680,6 @@
 * @return PropertyInfoStore
 */
private function newPropertyInfoStore() {
-   $wikibaseRepo = WikibaseRepo::getDefaultInstance();
$table = new PropertyInfoTable( false );
$cacheKey = $this-cacheKeyPrefix . ':CachingPropertyInfoStore';
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie01f822d5320009c0aa9bed11c8dd28426c1f7cb
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-06-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: Ie7ef09b4b6846e6ca69180d124eef9a5ff8dad1c
---
M lib/includes/store/sql/TermSqlIndex.php
M repo/includes/store/sql/TermSearchKeyBuilder.php
M repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
3 files changed, 10 insertions(+), 20 deletions(-)

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



diff --git a/lib/includes/store/sql/TermSqlIndex.php 
b/lib/includes/store/sql/TermSqlIndex.php
index 8ca553f..78f9c4b 100644
--- a/lib/includes/store/sql/TermSqlIndex.php
+++ b/lib/includes/store/sql/TermSqlIndex.php
@@ -332,7 +332,7 @@
'term_language' = $term-getLanguage(),
'term_type' = $term-getType(),
'term_text' = $term-getText(),
-   'term_search_key' = $this-getSearchKey( 
$term-getText(), $term-getLanguage() )
+   'term_search_key' = $this-getSearchKey( 
$term-getText() )
);
 
return $fields;
@@ -724,7 +724,7 @@
 
if ( !$options['caseSensitive'] ) {
$textField = 'term_search_key';
-   $text = $this-getSearchKey( $term-getText(), 
$term-getLanguage() );
+   $text = $this-getSearchKey( $term-getText() );
}
 
if ( $options['prefixSearch'] ) {
@@ -892,8 +892,8 @@
 
$matchConditions = array(
'L.term_language' = $lang,
-   'L.term_search_key' = $this-getSearchKey( 
$label, $lang ),
-   'D.term_search_key' = $this-getSearchKey( 
$description, $lang )
+   'L.term_search_key' = $this-getSearchKey( 
$label ),
+   'D.term_search_key' = $this-getSearchKey( 
$description )
);
 
$termConditions[] = $dbr-makeList( $matchConditions, 
LIST_AND );
@@ -953,12 +953,10 @@
 * @since 0.4
 *
 * @param string $text
-* @param string $lang language code of the text's language, may be used
-* for specialized normalization.
 *
 * @return string
 */
-   public function getSearchKey( $text, $lang = 'en' ) {
+   public function getSearchKey( $text ) {
if ( $text === null ) {
return null;
}
diff --git a/repo/includes/store/sql/TermSearchKeyBuilder.php 
b/repo/includes/store/sql/TermSearchKeyBuilder.php
index 69d28a2..1f74943 100644
--- a/repo/includes/store/sql/TermSearchKeyBuilder.php
+++ b/repo/includes/store/sql/TermSearchKeyBuilder.php
@@ -156,7 +156,7 @@
$cError = 0;
 
foreach ( $terms as $row ) {
-   $key = $this-updateSearchKey( $dbw, 
$row-term_row_id, $row-term_text, $row-term_language );
+   $key = $this-updateSearchKey( $dbw, 
$row-term_row_id, $row-term_text );
 
if ( $key === false ) {
$this-report( Unable to calculate 
search key for  . $row-term_text );
@@ -193,12 +193,11 @@
 * @param \DatabaseBase $dbw the database connection to use
 * @param int $rowId the row to update
 * @param string $text the term's text
-* @param string $lang the term's language
 *
 * @return string|bool the search key, or false if no search key could 
be calculated.
 */
-   protected function updateSearchKey( \DatabaseBase $dbw, $rowId, $text, 
$lang ) {
-   $key = $this-table-getSearchKey( $text, $lang );
+   protected function updateSearchKey( \DatabaseBase $dbw, $rowId, $text ) 
{
+   $key = $this-table-getSearchKey( $text );
 
if ( $key === '' ) {
wfDebugLog( __CLASS__, __FUNCTION__ . : failed to 
normalized term: $text );
diff --git a/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php 
b/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
index 81c767d..f0f1aad 100644
--- a/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
+++ b/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
@@ -295,37 +295,31 @@
return array(
array( // #0
'foo', // raw
-   'en',  // lang
'foo', // normalized
),
 
array( // #1
'  foo  ', // raw
-   'en',  // lang
'foo', // normalized
  

[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-05-25 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: Ie7ef09b4b6846e6ca69180d124eef9a5ff8dad1c
---
M lib/includes/store/sql/TermSqlIndex.php
M repo/includes/store/sql/TermSearchKeyBuilder.php
M repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
3 files changed, 10 insertions(+), 20 deletions(-)


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

diff --git a/lib/includes/store/sql/TermSqlIndex.php 
b/lib/includes/store/sql/TermSqlIndex.php
index 8ca553f..78f9c4b 100644
--- a/lib/includes/store/sql/TermSqlIndex.php
+++ b/lib/includes/store/sql/TermSqlIndex.php
@@ -332,7 +332,7 @@
'term_language' = $term-getLanguage(),
'term_type' = $term-getType(),
'term_text' = $term-getText(),
-   'term_search_key' = $this-getSearchKey( 
$term-getText(), $term-getLanguage() )
+   'term_search_key' = $this-getSearchKey( 
$term-getText() )
);
 
return $fields;
@@ -724,7 +724,7 @@
 
if ( !$options['caseSensitive'] ) {
$textField = 'term_search_key';
-   $text = $this-getSearchKey( $term-getText(), 
$term-getLanguage() );
+   $text = $this-getSearchKey( $term-getText() );
}
 
if ( $options['prefixSearch'] ) {
@@ -892,8 +892,8 @@
 
$matchConditions = array(
'L.term_language' = $lang,
-   'L.term_search_key' = $this-getSearchKey( 
$label, $lang ),
-   'D.term_search_key' = $this-getSearchKey( 
$description, $lang )
+   'L.term_search_key' = $this-getSearchKey( 
$label ),
+   'D.term_search_key' = $this-getSearchKey( 
$description )
);
 
$termConditions[] = $dbr-makeList( $matchConditions, 
LIST_AND );
@@ -953,12 +953,10 @@
 * @since 0.4
 *
 * @param string $text
-* @param string $lang language code of the text's language, may be used
-* for specialized normalization.
 *
 * @return string
 */
-   public function getSearchKey( $text, $lang = 'en' ) {
+   public function getSearchKey( $text ) {
if ( $text === null ) {
return null;
}
diff --git a/repo/includes/store/sql/TermSearchKeyBuilder.php 
b/repo/includes/store/sql/TermSearchKeyBuilder.php
index 69d28a2..1f74943 100644
--- a/repo/includes/store/sql/TermSearchKeyBuilder.php
+++ b/repo/includes/store/sql/TermSearchKeyBuilder.php
@@ -156,7 +156,7 @@
$cError = 0;
 
foreach ( $terms as $row ) {
-   $key = $this-updateSearchKey( $dbw, 
$row-term_row_id, $row-term_text, $row-term_language );
+   $key = $this-updateSearchKey( $dbw, 
$row-term_row_id, $row-term_text );
 
if ( $key === false ) {
$this-report( Unable to calculate 
search key for  . $row-term_text );
@@ -193,12 +193,11 @@
 * @param \DatabaseBase $dbw the database connection to use
 * @param int $rowId the row to update
 * @param string $text the term's text
-* @param string $lang the term's language
 *
 * @return string|bool the search key, or false if no search key could 
be calculated.
 */
-   protected function updateSearchKey( \DatabaseBase $dbw, $rowId, $text, 
$lang ) {
-   $key = $this-table-getSearchKey( $text, $lang );
+   protected function updateSearchKey( \DatabaseBase $dbw, $rowId, $text ) 
{
+   $key = $this-table-getSearchKey( $text );
 
if ( $key === '' ) {
wfDebugLog( __CLASS__, __FUNCTION__ . : failed to 
normalized term: $text );
diff --git a/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php 
b/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
index 81c767d..f0f1aad 100644
--- a/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
+++ b/repo/tests/phpunit/includes/store/sql/TermSqlIndexTest.php
@@ -295,37 +295,31 @@
return array(
array( // #0
'foo', // raw
-   'en',  // lang
'foo', // normalized
),
 
array( // #1
'  foo  ', // raw
-   'en',  // lang
  

[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-05-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: I796097b2132fd3ed1743e9845557ff7c5e24665a
---
M client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
1 file changed, 0 insertions(+), 7 deletions(-)

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



diff --git 
a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php 
b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
index 743c754..6bd0c4c 100644
--- a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
+++ b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
@@ -5,9 +5,7 @@
 use PHPUnit_Framework_MockObject_Matcher_Invocation;
 use Wikibase\Client\Store\Sql\ConsistentReadConnectionManager;
 use Wikibase\Client\WikibaseClient;
-use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\DataModel\Entity\Property;
 use Wikibase\Lib\Reporting\ExceptionHandler;
 use Wikibase\Lib\Reporting\MessageReporter;
 use Wikibase\Client\Store\Sql\BulkSubscriptionUpdater;
@@ -197,11 +195,6 @@
$db = wfGetDB( DB_MASTER );
$db-delete( 'wbc_entity_usage', '*' );
}
-
-   private static $entityTypeMap = array(
-   'Q' = Item::ENTITY_TYPE,
-   'P' = Property::ENTITY_TYPE,
-   );
 
private function putEntityUsage( array $entries ) {
$db = wfGetDB( DB_MASTER );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I796097b2132fd3ed1743e9845557ff7c5e24665a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-05-01 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: I796097b2132fd3ed1743e9845557ff7c5e24665a
---
M client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
1 file changed, 0 insertions(+), 7 deletions(-)


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

diff --git 
a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php 
b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
index 743c754..6bd0c4c 100644
--- a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
+++ b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
@@ -5,9 +5,7 @@
 use PHPUnit_Framework_MockObject_Matcher_Invocation;
 use Wikibase\Client\Store\Sql\ConsistentReadConnectionManager;
 use Wikibase\Client\WikibaseClient;
-use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\DataModel\Entity\Property;
 use Wikibase\Lib\Reporting\ExceptionHandler;
 use Wikibase\Lib\Reporting\MessageReporter;
 use Wikibase\Client\Store\Sql\BulkSubscriptionUpdater;
@@ -197,11 +195,6 @@
$db = wfGetDB( DB_MASTER );
$db-delete( 'wbc_entity_usage', '*' );
}
-
-   private static $entityTypeMap = array(
-   'Q' = Item::ENTITY_TYPE,
-   'P' = Property::ENTITY_TYPE,
-   );
 
private function putEntityUsage( array $entries ) {
$db = wfGetDB( DB_MASTER );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I796097b2132fd3ed1743e9845557ff7c5e24665a
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-01-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

This method can no longer return false since DM 2.0 (or 1.0, can't remember)

Change-Id: I790c62f59f00d4ceea619d46abaf41af78c3523d
---
M repo/includes/specials/SpecialNewItem.php
1 file changed, 1 insertion(+), 7 deletions(-)

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



diff --git a/repo/includes/specials/SpecialNewItem.php 
b/repo/includes/specials/SpecialNewItem.php
index 0d29cc0..61d34f6 100644
--- a/repo/includes/specials/SpecialNewItem.php
+++ b/repo/includes/specials/SpecialNewItem.php
@@ -81,13 +81,7 @@
return $status;
}
 
-   $link = new SiteLink( $site-getGlobalId(), $page );
-   $ret = $item-addSiteLink( $link );
-
-   if ( $ret === false ) {
-   $status-error( 
'wikibase-newitem-add-sitelink-failed' );
-   return $status;
-   }
+   $item-getSiteLinkList()-addNewSiteLink( 
$site-getGlobalId(), $page );
}
 
return $status;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I790c62f59f00d4ceea619d46abaf41af78c3523d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-01-20 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

This method can no longer return false since DM 2.0 (or 1.0, can't remember)

Change-Id: I790c62f59f00d4ceea619d46abaf41af78c3523d
---
M repo/includes/specials/SpecialNewItem.php
1 file changed, 1 insertion(+), 7 deletions(-)


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

diff --git a/repo/includes/specials/SpecialNewItem.php 
b/repo/includes/specials/SpecialNewItem.php
index 0d29cc0..61d34f6 100644
--- a/repo/includes/specials/SpecialNewItem.php
+++ b/repo/includes/specials/SpecialNewItem.php
@@ -81,13 +81,7 @@
return $status;
}
 
-   $link = new SiteLink( $site-getGlobalId(), $page );
-   $ret = $item-addSiteLink( $link );
-
-   if ( $ret === false ) {
-   $status-error( 
'wikibase-newitem-add-sitelink-failed' );
-   return $status;
-   }
+   $item-getSiteLinkList()-addNewSiteLink( 
$site-getGlobalId(), $page );
}
 
return $status;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I790c62f59f00d4ceea619d46abaf41af78c3523d
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-08-25 Thread WMDE
Thiemo Mättig (WMDE) has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: I948b69d396c1b63c59738fca3fbbb1d03fe07719
---
M client/includes/UpdateRepo.php
M client/tests/phpunit/includes/UpdateRepoOnMoveTest.php
2 files changed, 1 insertion(+), 19 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Checked

Objections:
  Hoo man: There's a problem with this change, please improve



diff --git a/client/includes/UpdateRepo.php b/client/includes/UpdateRepo.php
index 4a5088a..58804bd 100644
--- a/client/includes/UpdateRepo.php
+++ b/client/includes/UpdateRepo.php
@@ -136,20 +136,8 @@
$job = $this-createJob();
 
wfProfileIn( __METHOD__ . '#push' );
-   $result = $jobQueueGroup-push( $job );
+   $jobQueueGroup-push( $job );
wfProfileOut( __METHOD__ . '#push' );
-
-   // MediaWiki 1.24+ throws exceptions on error instead of 
returning false,
-   // but JobQueueGroup::push returns a useless true value.
-   //
-   // We do explicit check for false, for backwards compatibility 
with MediaWiki 1.23
-   // and to make robust in case the useless true return value is 
removed in core.
-   //
-   // @todo The check can be removed when we do not support 1.23 
anymore.
-   if ( $result === false ) {
-   wfProfileOut( __METHOD__ );
-   throw new RuntimeException( Failed to push job to job 
queue );
-   }
 
wfProfileOut( __METHOD__ );
}
diff --git a/client/tests/phpunit/includes/UpdateRepoOnMoveTest.php 
b/client/tests/phpunit/includes/UpdateRepoOnMoveTest.php
index 5d6692d..a02d2b2 100644
--- a/client/tests/phpunit/includes/UpdateRepoOnMoveTest.php
+++ b/client/tests/phpunit/includes/UpdateRepoOnMoveTest.php
@@ -121,11 +121,5 @@
$jobQueueGroupMock = $this-getJobQueueGroupMock( $job, true );
 
$updateRepo-injectJob( $jobQueueGroupMock );
-
-   // This is supposed to throw an exception in case it fails
-   $jobQueueGroupMock = $this-getJobQueueGroupMock( $job, false );
-   $this-setExpectedException( 'RuntimeException' );
-
-   $updateRepo-injectJob( $jobQueueGroupMock );
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I948b69d396c1b63c59738fca3fbbb1d03fe07719
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-08-25 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: I92767025aff7ac7642d0eded75d3b1d0bd026f73
---
M lib/maintenance/dispatchChanges.php
1 file changed, 1 insertion(+), 13 deletions(-)


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

diff --git a/lib/maintenance/dispatchChanges.php 
b/lib/maintenance/dispatchChanges.php
index e864476..4028a59 100644
--- a/lib/maintenance/dispatchChanges.php
+++ b/lib/maintenance/dispatchChanges.php
@@ -960,20 +960,8 @@
wfProfileOut( __METHOD__ . '#job' );
 
wfProfileIn( __METHOD__ . '#push' );
-   $result = $qgroup-push( $job );
+   $qgroup-push( $job );
wfProfileOut( __METHOD__ . '#push' );
-
-   // MediaWiki 1.24+ throws exceptions on error instead of 
returning false,
-   // but JobQueueGroup::push returns a useless true value.
-   //
-   // We do explicit check for false, for backwards compatibility 
with MediaWiki 1.23
-   // and to make robust in case the useless true return value is 
removed in core.
-   //
-   // @todo The check can be removed when we do not support 1.23 
anymore.
-   if ( $result === false ) {
-   wfProfileOut( __METHOD__ );
-   throw new \MWException( Failed to push to job queue 
for $wikiDB );
-   }
 
$this-trace( Posted notification job for site $siteID with 
. count( $changes ) .  changes to $wikiDB. );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92767025aff7ac7642d0eded75d3b1d0bd026f73
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-08-25 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: I92767025aff7ac7642d0eded75d3b1d0bd026f73
---
M lib/maintenance/dispatchChanges.php
1 file changed, 1 insertion(+), 13 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Checked



diff --git a/lib/maintenance/dispatchChanges.php 
b/lib/maintenance/dispatchChanges.php
index e864476..4028a59 100644
--- a/lib/maintenance/dispatchChanges.php
+++ b/lib/maintenance/dispatchChanges.php
@@ -960,20 +960,8 @@
wfProfileOut( __METHOD__ . '#job' );
 
wfProfileIn( __METHOD__ . '#push' );
-   $result = $qgroup-push( $job );
+   $qgroup-push( $job );
wfProfileOut( __METHOD__ . '#push' );
-
-   // MediaWiki 1.24+ throws exceptions on error instead of 
returning false,
-   // but JobQueueGroup::push returns a useless true value.
-   //
-   // We do explicit check for false, for backwards compatibility 
with MediaWiki 1.23
-   // and to make robust in case the useless true return value is 
removed in core.
-   //
-   // @todo The check can be removed when we do not support 1.23 
anymore.
-   if ( $result === false ) {
-   wfProfileOut( __METHOD__ );
-   throw new \MWException( Failed to push to job queue 
for $wikiDB );
-   }
 
$this-trace( Posted notification job for site $siteID with 
. count( $changes ) .  changes to $wikiDB. );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I92767025aff7ac7642d0eded75d3b1d0bd026f73
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-08-25 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: Ib17e56c41fc19b1f20c5956edd9043e726a89e46
---
M client/WikibaseClient.hooks.php
1 file changed, 1 insertion(+), 4 deletions(-)


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

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index e7a5075..cee6c79 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -19,7 +19,6 @@
 use RecentChange;
 use RecursiveDirectoryIterator;
 use RecursiveIteratorIterator;
-use RuntimeException;
 use Skin;
 use SpecialRecentChanges;
 use SpecialWatchlist;
@@ -923,9 +922,6 @@
// show a message to the user that the Wikibase item 
needs to be
// manually updated.
wfLogWarning( $e-getMessage() );
-   } catch( RuntimeException $e ) {
-   // B/C for MediaWiki 1.23
-   wfLogWarning( $e-getMessage() );
}
 
wfProfileOut( __METHOD__ );
@@ -947,4 +943,5 @@
$html .= $link;
}
}
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib17e56c41fc19b1f20c5956edd9043e726a89e46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-08-25 Thread Hoo man (Code Review)
Hoo man has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: Ib17e56c41fc19b1f20c5956edd9043e726a89e46
---
M client/WikibaseClient.hooks.php
1 file changed, 1 insertion(+), 4 deletions(-)

Approvals:
  Hoo man: Looks good to me, approved
  WikidataJenkins: Verified
  jenkins-bot: Checked



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index e7a5075..cee6c79 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -19,7 +19,6 @@
 use RecentChange;
 use RecursiveDirectoryIterator;
 use RecursiveIteratorIterator;
-use RuntimeException;
 use Skin;
 use SpecialRecentChanges;
 use SpecialWatchlist;
@@ -923,9 +922,6 @@
// show a message to the user that the Wikibase item 
needs to be
// manually updated.
wfLogWarning( $e-getMessage() );
-   } catch( RuntimeException $e ) {
-   // B/C for MediaWiki 1.23
-   wfLogWarning( $e-getMessage() );
}
 
wfProfileOut( __METHOD__ );
@@ -947,4 +943,5 @@
$html .= $link;
}
}
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib17e56c41fc19b1f20c5956edd9043e726a89e46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-08-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: I948b69d396c1b63c59738fca3fbbb1d03fe07719
---
M client/includes/UpdateRepo.php
1 file changed, 1 insertion(+), 13 deletions(-)


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

diff --git a/client/includes/UpdateRepo.php b/client/includes/UpdateRepo.php
index 4a5088a..58804bd 100644
--- a/client/includes/UpdateRepo.php
+++ b/client/includes/UpdateRepo.php
@@ -136,20 +136,8 @@
$job = $this-createJob();
 
wfProfileIn( __METHOD__ . '#push' );
-   $result = $jobQueueGroup-push( $job );
+   $jobQueueGroup-push( $job );
wfProfileOut( __METHOD__ . '#push' );
-
-   // MediaWiki 1.24+ throws exceptions on error instead of 
returning false,
-   // but JobQueueGroup::push returns a useless true value.
-   //
-   // We do explicit check for false, for backwards compatibility 
with MediaWiki 1.23
-   // and to make robust in case the useless true return value is 
removed in core.
-   //
-   // @todo The check can be removed when we do not support 1.23 
anymore.
-   if ( $result === false ) {
-   wfProfileOut( __METHOD__ );
-   throw new RuntimeException( Failed to push job to job 
queue );
-   }
 
wfProfileOut( __METHOD__ );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I948b69d396c1b63c59738fca3fbbb1d03fe07719
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-07-25 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: Iaeba1c3b90127de7b9b1a468e2252be6a212cf3f
---
M lib/tests/phpunit/entity/EntityFactoryTest.php
D lib/tests/phpunit/entity/EntityTestCase.php
M lib/tests/phpunit/store/EntityContentDataCodecTest.php
3 files changed, 2 insertions(+), 55 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/tests/phpunit/entity/EntityFactoryTest.php 
b/lib/tests/phpunit/entity/EntityFactoryTest.php
index 86dbb56..2586872 100644
--- a/lib/tests/phpunit/entity/EntityFactoryTest.php
+++ b/lib/tests/phpunit/entity/EntityFactoryTest.php
@@ -17,7 +17,7 @@
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  * @author Daniel Kinzler
  */
-class EntityFactoryTest extends EntityTestCase {
+class EntityFactoryTest extends \MediaWikiTestCase {
 
public function testGetEntityTypes() {
$types = EntityFactory::singleton()-getEntityTypes();
diff --git a/lib/tests/phpunit/entity/EntityTestCase.php 
b/lib/tests/phpunit/entity/EntityTestCase.php
deleted file mode 100644
index 87d7618..000
--- a/lib/tests/phpunit/entity/EntityTestCase.php
+++ /dev/null
@@ -1,53 +0,0 @@
-?php
-
-namespace Wikibase\Test;
-
-use Wikibase\DataModel\Entity\Entity;
-
-/**
- * Base class for tests that have to inspect entity structures.
- *
- * @since 0.3
- *
- * @licence GNU GPL v2+
- * @author Daniel Kinzler
- */
-abstract class EntityTestCase extends \MediaWikiTestCase {
-
-   /**
-* @param Entity|array $expected
-* @param Entity|array $actual
-* @param String|null  $message
-*/
-   protected function assertEntityStructureEquals( $expected, $actual, 
$message = null ) {
-   if ( $expected instanceof Entity ) {
-   $expected = $expected-toArray();
-   }
-
-   if ( $actual instanceof Entity ) {
-   $actual = $actual-toArray();
-   }
-
-   $keys = array_unique( array_merge(
-   array_keys( $expected ),
-   array_keys( $actual ) ) );
-
-   foreach ( $keys as $k ) {
-   if ( empty( $expected[ $k ] ) ) {
-   if ( !empty( $actual[ $k ] ) ) {
-   $this-fail( $k should be empty; 
$message );
-   }
-   } else {
-   if ( empty( $actual[ $k ] ) ) {
-   $this-fail( $k should not be empty; 
$message );
-   }
-
-   if ( is_array( $expected[ $k ] )  is_array( 
$actual[ $k ] ) ) {
-   $this-assertArrayEquals( $expected[ $k 
], $actual[ $k ], false, true );
-   } else {
-   $this-assertEquals( $expected[ $k ], 
$actual[ $k ], field $k );
-   }
-   }
-   }
-   }
-}
diff --git a/lib/tests/phpunit/store/EntityContentDataCodecTest.php 
b/lib/tests/phpunit/store/EntityContentDataCodecTest.php
index f799976..7c1b6dd 100644
--- a/lib/tests/phpunit/store/EntityContentDataCodecTest.php
+++ b/lib/tests/phpunit/store/EntityContentDataCodecTest.php
@@ -24,7 +24,7 @@
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
  */
-class EntityContentDataCodecTest extends EntityTestCase {
+class EntityContentDataCodecTest extends \MediaWikiTestCase {
 
/**
 * @var EntityContentDataCodec

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaeba1c3b90127de7b9b1a468e2252be6a212cf3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-07-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: Iaeba1c3b90127de7b9b1a468e2252be6a212cf3f
---
M lib/tests/phpunit/entity/EntityFactoryTest.php
D lib/tests/phpunit/entity/EntityTestCase.php
M lib/tests/phpunit/store/EntityContentDataCodecTest.php
3 files changed, 2 insertions(+), 55 deletions(-)


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

diff --git a/lib/tests/phpunit/entity/EntityFactoryTest.php 
b/lib/tests/phpunit/entity/EntityFactoryTest.php
index 86dbb56..2586872 100644
--- a/lib/tests/phpunit/entity/EntityFactoryTest.php
+++ b/lib/tests/phpunit/entity/EntityFactoryTest.php
@@ -17,7 +17,7 @@
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  * @author Daniel Kinzler
  */
-class EntityFactoryTest extends EntityTestCase {
+class EntityFactoryTest extends \MediaWikiTestCase {
 
public function testGetEntityTypes() {
$types = EntityFactory::singleton()-getEntityTypes();
diff --git a/lib/tests/phpunit/entity/EntityTestCase.php 
b/lib/tests/phpunit/entity/EntityTestCase.php
deleted file mode 100644
index 87d7618..000
--- a/lib/tests/phpunit/entity/EntityTestCase.php
+++ /dev/null
@@ -1,53 +0,0 @@
-?php
-
-namespace Wikibase\Test;
-
-use Wikibase\DataModel\Entity\Entity;
-
-/**
- * Base class for tests that have to inspect entity structures.
- *
- * @since 0.3
- *
- * @licence GNU GPL v2+
- * @author Daniel Kinzler
- */
-abstract class EntityTestCase extends \MediaWikiTestCase {
-
-   /**
-* @param Entity|array $expected
-* @param Entity|array $actual
-* @param String|null  $message
-*/
-   protected function assertEntityStructureEquals( $expected, $actual, 
$message = null ) {
-   if ( $expected instanceof Entity ) {
-   $expected = $expected-toArray();
-   }
-
-   if ( $actual instanceof Entity ) {
-   $actual = $actual-toArray();
-   }
-
-   $keys = array_unique( array_merge(
-   array_keys( $expected ),
-   array_keys( $actual ) ) );
-
-   foreach ( $keys as $k ) {
-   if ( empty( $expected[ $k ] ) ) {
-   if ( !empty( $actual[ $k ] ) ) {
-   $this-fail( $k should be empty; 
$message );
-   }
-   } else {
-   if ( empty( $actual[ $k ] ) ) {
-   $this-fail( $k should not be empty; 
$message );
-   }
-
-   if ( is_array( $expected[ $k ] )  is_array( 
$actual[ $k ] ) ) {
-   $this-assertArrayEquals( $expected[ $k 
], $actual[ $k ], false, true );
-   } else {
-   $this-assertEquals( $expected[ $k ], 
$actual[ $k ], field $k );
-   }
-   }
-   }
-   }
-}
diff --git a/lib/tests/phpunit/store/EntityContentDataCodecTest.php 
b/lib/tests/phpunit/store/EntityContentDataCodecTest.php
index f799976..7c1b6dd 100644
--- a/lib/tests/phpunit/store/EntityContentDataCodecTest.php
+++ b/lib/tests/phpunit/store/EntityContentDataCodecTest.php
@@ -24,7 +24,7 @@
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
  */
-class EntityContentDataCodecTest extends EntityTestCase {
+class EntityContentDataCodecTest extends \MediaWikiTestCase {
 
/**
 * @var EntityContentDataCodec

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaeba1c3b90127de7b9b1a468e2252be6a212cf3f
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-06-02 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Remove dead code
..

Remove dead code

Change-Id: Icb5276302540d1487f25f37a2cf7b6c04316805a
---
M repo/includes/content/EntityContentFactory.php
M repo/tests/phpunit/includes/DiffViewTest.php
2 files changed, 0 insertions(+), 28 deletions(-)


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

diff --git a/repo/includes/content/EntityContentFactory.php 
b/repo/includes/content/EntityContentFactory.php
index 4c0dc2f..cc983bc 100644
--- a/repo/includes/content/EntityContentFactory.php
+++ b/repo/includes/content/EntityContentFactory.php
@@ -62,33 +62,6 @@
}
 
/**
-* Get the entity content for the entity with the provided id
-* if it's available to the specified audience.
-* If the specified audience does not have the ability to view this
-* revision, if there is no such item, null will be returned.
-*
-* @since 0.2
-*
-* @deprecated use EntityLookup instead.
-*
-* @param EntityId $id
-*
-* @param integer $audience: one of:
-*  Revision::FOR_PUBLIC   to be displayed to all users
-*  Revision::FOR_THIS_USERto be displayed to $wgUser
-*  Revision::RAW  get the text regardless of 
permissions
-*
-* @return EntityContent|null
-*/
-   private function getFromId( EntityId $id, $audience = 
Revision::FOR_PUBLIC ) {
-   // TODO: since we already did the trouble of getting a WikiPage 
here,
-   // we probably want to keep a copy of it in the Content object.
-   $title = $this-getTitleForId( $id );
-   $page = new WikiPage( $title );
-   return $page-getContent( $audience );
-   }
-
-   /**
 * Returns the Title object for the item with provided id.
 *
 * @since 0.3
diff --git a/repo/tests/phpunit/includes/DiffViewTest.php 
b/repo/tests/phpunit/includes/DiffViewTest.php
index e114a95..2fbc484 100644
--- a/repo/tests/phpunit/includes/DiffViewTest.php
+++ b/repo/tests/phpunit/includes/DiffViewTest.php
@@ -3,7 +3,6 @@
 namespace Wikibase\Test;
 
 use Diff\DiffOp\Diff\Diff;
-use Diff\DiffOp\DiffOp;
 use Diff\DiffOp\DiffOpAdd;
 use Diff\DiffOp\DiffOpChange;
 use Diff\DiffOp\DiffOpRemove;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb5276302540d1487f25f37a2cf7b6c04316805a
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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2014-06-02 Thread Hoo man (Code Review)
Hoo man has submitted this change and it was merged.

Change subject: Remove dead code
..


Remove dead code

Change-Id: Icb5276302540d1487f25f37a2cf7b6c04316805a
---
M repo/includes/content/EntityContentFactory.php
M repo/tests/phpunit/includes/DiffViewTest.php
2 files changed, 0 insertions(+), 28 deletions(-)

Approvals:
  Hoo man: Looks good to me, approved
  WikidataJenkins: Verified



diff --git a/repo/includes/content/EntityContentFactory.php 
b/repo/includes/content/EntityContentFactory.php
index 4c0dc2f..cc983bc 100644
--- a/repo/includes/content/EntityContentFactory.php
+++ b/repo/includes/content/EntityContentFactory.php
@@ -62,33 +62,6 @@
}
 
/**
-* Get the entity content for the entity with the provided id
-* if it's available to the specified audience.
-* If the specified audience does not have the ability to view this
-* revision, if there is no such item, null will be returned.
-*
-* @since 0.2
-*
-* @deprecated use EntityLookup instead.
-*
-* @param EntityId $id
-*
-* @param integer $audience: one of:
-*  Revision::FOR_PUBLIC   to be displayed to all users
-*  Revision::FOR_THIS_USERto be displayed to $wgUser
-*  Revision::RAW  get the text regardless of 
permissions
-*
-* @return EntityContent|null
-*/
-   private function getFromId( EntityId $id, $audience = 
Revision::FOR_PUBLIC ) {
-   // TODO: since we already did the trouble of getting a WikiPage 
here,
-   // we probably want to keep a copy of it in the Content object.
-   $title = $this-getTitleForId( $id );
-   $page = new WikiPage( $title );
-   return $page-getContent( $audience );
-   }
-
-   /**
 * Returns the Title object for the item with provided id.
 *
 * @since 0.3
diff --git a/repo/tests/phpunit/includes/DiffViewTest.php 
b/repo/tests/phpunit/includes/DiffViewTest.php
index e114a95..2fbc484 100644
--- a/repo/tests/phpunit/includes/DiffViewTest.php
+++ b/repo/tests/phpunit/includes/DiffViewTest.php
@@ -3,7 +3,6 @@
 namespace Wikibase\Test;
 
 use Diff\DiffOp\Diff\Diff;
-use Diff\DiffOp\DiffOp;
 use Diff\DiffOp\DiffOpAdd;
 use Diff\DiffOp\DiffOpChange;
 use Diff\DiffOp\DiffOpRemove;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb5276302540d1487f25f37a2cf7b6c04316805a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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