File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222* Removed ` Claims::getHash ` (and ` Claims ` no longer implements ` Hashable ` )
2323* Removed ` Claims::isEmpty ` (you can use ` StatementList::isEmpty ` instead)
2424* Removed ` Claims::indexOf ` (you can use ` StatementList::getIndexByGuid ` instead)
25+ * Removed ` Claims::removeClaim `
2526* Removed ` Entity::getAllSnaks ` , use ` StatementList::getAllSnaks ` instead
2627* Removed ` EntityId::getPrefixedId ` , use ` EntityId::getSerialization ` instead
2728
Original file line number Diff line number Diff line change @@ -135,25 +135,6 @@ public function hasClaim( Claim $claim ) {
135135 return $ this ->offsetExists ( $ key );
136136 }
137137
138- /**
139- * @since 0.1
140- *
141- * @param Claim $claim
142- */
143- public function removeClaim ( Claim $ claim ) {
144- $ guid = $ claim ->getGuid ();
145-
146- if ( $ guid === null ) {
147- return ;
148- }
149-
150- $ key = $ this ->getGuidKey ( $ guid );
151-
152- if ( $ this ->offsetExists ( $ key ) ) {
153- $ this ->offsetUnset ( $ key );
154- }
155- }
156-
157138 /**
158139 * @since 0.3
159140 *
Original file line number Diff line number Diff line change @@ -123,30 +123,6 @@ public function testHasClaimWithGuid() {
123123 $ this ->assertTrue ( $ claims ->hasClaimWithGuid ( $ claim2 ->getGuid () ) );
124124 }
125125
126- public function testRemoveClaim () {
127- $ claims = new Claims ();
128- $ claim1 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P15 ' ) ) );
129- $ claim2 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P16 ' ) ) );
130-
131- $ claims ->addClaim ( $ claim1 );
132- $ claims ->addClaim ( $ claim2 );
133- $ this ->assertSame ( 2 , $ claims ->count () );
134-
135- $ claims ->removeClaim ( $ claim1 );
136- $ this ->assertFalse ( $ claims ->hasClaim ( $ claim1 ) );
137- $ this ->assertNull ( $ claims ->getClaimWithGuid ( $ claim1 ->getGuid () ) );
138- $ this ->assertSame ( 1 , $ claims ->count () );
139-
140- $ claims ->removeClaim ( $ claim2 );
141- $ this ->assertFalse ( $ claims ->hasClaim ( $ claim2 ) );
142- $ this ->assertNull ( $ claims ->getClaimWithGuid ( $ claim2 ->getGuid () ) );
143- $ this ->assertSame ( 0 , $ claims ->count () );
144-
145- // no guid
146- $ claim0 = new Claim ( new PropertyNoValueSnak ( new PropertyId ( 'P15 ' ) ) );
147- $ claims ->removeClaim ( $ claim0 );
148- }
149-
150126 public function testRemoveClaimWithGuid () {
151127 $ claims = new Claims ();
152128 $ claim1 = $ this ->makeClaim ( new PropertyNoValueSnak ( new PropertyId ( 'P15 ' ) ) );
You can’t perform that action at this time.
0 commit comments