Skip to content

Commit 402590a

Browse files
committed
Merge pull request #429 from wmde/hasClaims
Drop deprecated Entity::hasClaims
2 parents e2762c2 + d3252ef commit 402590a

5 files changed

Lines changed: 1 addition & 44 deletions

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* `Statement::setClaim` and `Statement::getClaim` have been removed
1212
* Removed `ClaimList`
1313
* Removed `ClaimListAccess`
14+
* Removed `hasClaims` from all entity classes
1415
* Removed `Claims::getBestClaims` (you can use `StatementList::getBestStatements` instead)
1516
* Removed `Claims::getByRank` and `Claims::getByRanks` (you can use `StatementList::getWithRank` instead)
1617
* Removed `Claims::getMainSnaks` (you can use `StatementList::getMainSnaks` instead)

src/Entity/Entity.php

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

374-
/**
375-
* Convenience function to check if the entity contains any claims.
376-
*
377-
* On top of being a convenience function, this implementation allows for doing
378-
* the check without forcing an unstub in contrast to count( $this->getClaims() ).
379-
*
380-
* @since 0.2
381-
* @deprecated since 1.0, use getStatements()->isEmpty() instead.
382-
*
383-
* @return bool
384-
*/
385-
public function hasClaims() {
386-
return false;
387-
}
388-
389374
/**
390375
* @since 0.3
391376
* @deprecated since 1.0, use new Statement() instead.

src/Entity/Item.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,6 @@ public function setClaims( Claims $claims ) {
290290
$this->statements = new StatementList( iterator_to_array( $claims ) );
291291
}
292292

293-
/**
294-
* @deprecated since 1.0, use getStatements()->isEmpty() instead.
295-
*
296-
* @return bool
297-
*/
298-
public function hasClaims() {
299-
return !$this->statements->isEmpty();
300-
}
301-
302293
/**
303294
* @see Comparable::equals
304295
*

src/Entity/Property.php

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

226-
/**
227-
* @deprecated since 1.0, use getStatements()->isEmpty() instead.
228-
*
229-
* @return bool
230-
*/
231-
public function hasClaims() {
232-
return !$this->statements->isEmpty();
233-
}
234-
235226
/**
236227
* @deprecated since 1.0, use new Statement() instead.
237228
*

tests/unit/Entity/EntityTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -403,17 +403,6 @@ public function testSerialize( Entity $entity ) {
403403
$this->assertEquals( $entity->getId(), $instance->getId() );
404404
}
405405

406-
/**
407-
* @dataProvider instanceProvider
408-
* @param Entity $entity
409-
*/
410-
public function testHasClaims( Entity $entity ) {
411-
$has = $entity->hasClaims();
412-
$this->assertInternalType( 'boolean', $has );
413-
414-
$this->assertEquals( count( $entity->getClaims() ) !== 0, $has );
415-
}
416-
417406
public function diffProvider() {
418407
$argLists = array();
419408

0 commit comments

Comments
 (0)