Skip to content

Commit 9f63f7a

Browse files
committed
Rename getWithPropertyId to getByPropertyId
1 parent e646410 commit 9f63f7a

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Other breaking changes:
3636
* Removed previously deprecated `Entity::getAllSnaks`, use `StatementList::getAllSnaks` instead
3737
* Removed previously deprecated `EntityId::getPrefixedId`, use `EntityId::getSerialization` instead
3838
* Removed previously deprecated `Property::newEmpty`, use `Property::newFromType` or `new Property()` instead
39+
* Renamed `StatementList::getWithPropertyId` to `StatementList::getByPropertyId`
3940
* `Reference` and `ReferenceList`s no longer can not be instantiated with `null`
4041
* Added `setId` method to `EntityDocument`
4142

src/Statement/StatementList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ public function getWithUniqueMainSnaks() {
138138
}
139139

140140
/**
141-
* @since 2.3
141+
* @since 3.0
142142
*
143143
* @param PropertyId $id
144144
*
145145
* @return self
146146
*/
147-
public function getWithPropertyId( PropertyId $id ) {
147+
public function getByPropertyId( PropertyId $id ) {
148148
$statementList = new self();
149149

150150
foreach ( $this->statements as $statement ) {

tests/unit/Statement/StatementListTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,17 +516,17 @@ public function testGetMainSnaks() {
516516
);
517517
}
518518

519-
public function testGivenNotKnownPropertyId_getWithPropertyIdReturnsEmptyList() {
519+
public function testGivenNotKnownPropertyId_getByPropertyIdReturnsEmptyList() {
520520
$list = new StatementList();
521521
$list->addNewStatement( new PropertyNoValueSnak( 42 ) );
522522

523523
$this->assertEquals(
524524
new StatementList(),
525-
$list->getWithPropertyId( new PropertyId( 'P2' ) )
525+
$list->getByPropertyId( new PropertyId( 'P2' ) )
526526
);
527527
}
528528

529-
public function testGivenKnownPropertyId_getWithPropertyIdReturnsListWithOnlyMatchingStatements() {
529+
public function testGivenKnownPropertyId_getByPropertyIdReturnsListWithOnlyMatchingStatements() {
530530
$list = new StatementList();
531531
$list->addNewStatement( new PropertyNoValueSnak( 42 ) );
532532
$list->addNewStatement( new PropertyNoValueSnak( 9001 ) );
@@ -539,7 +539,7 @@ public function testGivenKnownPropertyId_getWithPropertyIdReturnsListWithOnlyMat
539539

540540
$this->assertEquals(
541541
$expected,
542-
$list->getWithPropertyId( new PropertyId( 'P42' ) )
542+
$list->getByPropertyId( new PropertyId( 'P42' ) )
543543
);
544544
}
545545

0 commit comments

Comments
 (0)