Skip to content

Commit ff6ad1d

Browse files
committed
Merge pull request #428 from wmde/newClaim
Drop deprecated Entity::newClaim
2 parents 7468ba1 + db1b477 commit ff6ad1d

6 files changed

Lines changed: 1 addition & 55 deletions

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Removed `ClaimList`
1313
* Removed `ClaimListAccess`
1414
* Removed `hasClaims` from all entity classes
15+
* Removed `newClaim` from all entity classes
1516
* Removed `Claims::getBestClaims` (you can use `StatementList::getBestStatements` instead)
1617
* Removed `Claims::getByRank` and `Claims::getByRanks` (you can use `StatementList::getWithRank` instead)
1718
* Removed `Claims::getMainSnaks` (you can use `StatementList::getMainSnaks` instead)

src/Entity/Entity.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -371,18 +371,6 @@ public function getClaims() {
371371
return array();
372372
}
373373

374-
/**
375-
* @since 0.3
376-
* @deprecated since 1.0, use new Statement() instead.
377-
*
378-
* @param Snak $mainSnak
379-
*
380-
* @return Statement
381-
*/
382-
public function newClaim( Snak $mainSnak ) {
383-
return new Statement( $mainSnak );
384-
}
385-
386374
/**
387375
* Returns an EntityDiff between $this and the provided Entity.
388376
*

src/Entity/Item.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,6 @@ public function getType() {
199199
return self::ENTITY_TYPE;
200200
}
201201

202-
/**
203-
* @deprecated since 1.0, use new Statement() instead.
204-
*
205-
* @param Snak $mainSnak
206-
*
207-
* @return Statement
208-
*/
209-
public function newClaim( Snak $mainSnak ) {
210-
return new Statement( $mainSnak );
211-
}
212-
213202
/**
214203
* Returns if the Item has no content.
215204
* Having an id set does not count as having content.

src/Entity/Property.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,6 @@ public function setClaims( Claims $claims ) {
222222
$this->statements = new StatementList( iterator_to_array( $claims ) );
223223
}
224224

225-
/**
226-
* @deprecated since 1.0, use new Statement() instead.
227-
*
228-
* @param Snak $mainSnak
229-
*
230-
* @return Statement
231-
*/
232-
public function newClaim( Snak $mainSnak ) {
233-
return new Statement( $mainSnak );
234-
}
235-
236225
/**
237226
* @deprecated since 1.0, use getStatements()->addStatement() instead.
238227
*

tests/unit/Entity/ItemTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -494,17 +494,6 @@ public function testHasLinkToSiteForTrue() {
494494
$this->assertTrue( $item->getSiteLinkList()->hasLinkWithSiteId( 'foo bar' ) );
495495
}
496496

497-
public function testNewClaimReturnsStatementWithProvidedMainSnak() {
498-
/** @var Snak $snak */
499-
$snak = $this->getMock( 'Wikibase\DataModel\Snak\Snak' );
500-
501-
$item = new Item();
502-
$statement = $item->newClaim( $snak );
503-
504-
$this->assertInstanceOf( 'Wikibase\DataModel\Statement\Statement', $statement );
505-
$this->assertEquals( $snak, $statement->getMainSnak() );
506-
}
507-
508497
public function testSetClaims() {
509498
$item = new Item();
510499

tests/unit/Entity/PropertyTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,6 @@ public function testPropertyWithStatementsIsNotEmpty() {
232232
$this->assertFalse( $property->isEmpty() );
233233
}
234234

235-
public function testNewClaimReturnsStatementWithProvidedMainSnak() {
236-
$snak = $this->getMock( 'Wikibase\DataModel\Snak\Snak' );
237-
238-
$property = Property::newFromType( 'string' );
239-
$statement = $property->newClaim( $snak );
240-
241-
$this->assertInstanceOf( 'Wikibase\DataModel\Statement\Statement', $statement );
242-
$this->assertEquals( $snak, $statement->getMainSnak() );
243-
}
244-
245235
public function testSetClaims() {
246236
$property = Property::newFromType( 'string' );
247237

0 commit comments

Comments
 (0)