Skip to content

Commit 30d71da

Browse files
committed
Merge pull request #317 from wmde/removeClaim
Remove claim
2 parents bde7acf + 13a06cd commit 30d71da

11 files changed

Lines changed: 68 additions & 578 deletions

File tree

Aliases.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
// This is a IDE helper to understand class aliasing.
4+
// It should not be included anywhere.
5+
// Actual aliasing happens in the entry point using class_alias.
6+
7+
namespace { throw new Exception( 'This code is not meant to be executed' ); }
8+
9+
namespace Wikibase\DataModel\Claim {
10+
11+
/**
12+
* @deprecated since 3.0.0, use the base class instead.
13+
*/
14+
class Claim extends \Wikibase\DataModel\Statement\Statement {}
15+
16+
}

RELEASE-NOTES.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
## Version 3.0.0 (dev)
44

5-
* `Statement` no longer takes a `Claim` in its constructor
6-
* `Statement::setClaim` and `Statement::getClaim` have been removed
7-
* Removed `ClaimList`
8-
* Removed `ClaimListAccess`
5+
* The concept of `Claim` is no longer modelled
6+
* The `Claim` class itself has been removed, though `Claim` is now a temporary alias for `Statement`
7+
* `Claim::RANK_TRUTH` have been removed
8+
* `Statement` no longer takes a `Claim` in its constructor
9+
* `Statement::setClaim` and `Statement::getClaim` have been removed
10+
* Removed `ClaimList`
11+
* Removed `ClaimListAccess`
912

1013
## Version 2.6.0 (dev)
1114

WikibaseDataModel.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919
require_once __DIR__ . '/WikibaseDataModel.mw.php';
2020
} );
2121
}
22+
23+
// Aliases introduced in 3.0.0
24+
class_alias( 'Wikibase\DataModel\Statement\Statement', 'Wikibase\DataModel\Claim\Claim' );

src/Claim/Claim.php

Lines changed: 0 additions & 234 deletions
This file was deleted.

src/Claim/Claims.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* A claim (identified using it's GUID) can only be added once.
1717
*
18-
* @deprecated since 1.0
18+
* @deprecated since 1.0, use StatementList and associated classes instead.
1919
*
2020
* @licence GNU GPL v2+
2121
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
@@ -63,8 +63,6 @@ private function getGuidKey( $guid ) {
6363
}
6464

6565
/**
66-
* @param Claim $claim
67-
*
6866
* @param Claim $claim
6967
*
7068
* @throws InvalidArgumentException
@@ -437,7 +435,7 @@ public function getByRanks( array $ranks ) {
437435
* @return Claims
438436
*/
439437
public function getBestClaims() {
440-
$rank = Claim::RANK_TRUTH;
438+
$rank = Statement::RANK_PREFERRED;
441439

442440
do {
443441
$claims = $this->getByRank( $rank );

0 commit comments

Comments
 (0)