File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use Diff \Patcher \MapPatcher ;
66use InvalidArgumentException ;
7+ use RuntimeException ;
78use Wikibase \DataModel \Claim \Claim ;
89use Wikibase \DataModel \Entity \Diff \EntityDiff ;
910use Wikibase \DataModel \Entity \Diff \EntityDiffer ;
@@ -358,8 +359,10 @@ public function copy() {
358359 * @param Claim $claim
359360 *
360361 * @throws InvalidArgumentException
362+ * @throws RuntimeException
361363 */
362364 public function addClaim ( Claim $ claim ) {
365+ throw new RuntimeException ( 'Claims on entities are not supported any more. ' );
363366 }
364367
365368 /**
Original file line number Diff line number Diff line change 1010use OutOfBoundsException ;
1111use Wikibase \DataModel \Claim \Claim ;
1212use Wikibase \DataModel \Claim \Claims ;
13- use Wikibase \DataModel \Statement \Statement ;
1413use Wikibase \DataModel \Entity \Diff \EntityDiff ;
1514use Wikibase \DataModel \Entity \Diff \ItemDiff ;
1615use Wikibase \DataModel \SiteLink ;
1716use Wikibase \DataModel \SiteLinkList ;
1817use Wikibase \DataModel \Snak \Snak ;
18+ use Wikibase \DataModel \Statement \Statement ;
1919use Wikibase \DataModel \Statement \StatementList ;
2020use Wikibase \DataModel \Term \Fingerprint ;
2121
@@ -326,7 +326,9 @@ function( Claim $firstClaim, Claim $secondClaim ) {
326326 * @throws InvalidArgumentException
327327 */
328328 public function addClaim ( Claim $ statement ) {
329- if ( $ statement ->getGuid () === null ) {
329+ if ( !( $ statement instanceof Statement ) ) {
330+ throw new InvalidArgumentException ( 'Claims are not supported any more, use Statements. ' );
331+ } elseif ( $ statement ->getGuid () === null ) {
330332 throw new InvalidArgumentException ( 'Can \'t add a Claim without a GUID. ' );
331333 }
332334
You can’t perform that action at this time.
0 commit comments