Skip to content

Commit e646410

Browse files
committed
Merge pull request #487 from wmde/withVsBy
Partial revert of the With vs. By inconsistency
2 parents eda783b + e1ac24d commit e646410

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/Statement/StatementByGuidMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private function assertIsStatementGuid( $statementGuid ) {
7272
*
7373
* @return Statement|null
7474
*/
75-
public function getStatementWithGuid( $statementGuid ) {
75+
public function getStatementByGuid( $statementGuid ) {
7676
$this->assertIsStatementGuid( $statementGuid );
7777

7878
if ( array_key_exists( $statementGuid, $this->statements ) ) {

src/Statement/StatementList.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ public function removeStatementsWithGuid( $guid ) {
123123
* Statements that have a main snak already in the list are filtered out.
124124
* The last occurrences are retained.
125125
*
126+
* @since 1.0
127+
*
126128
* @return self
127129
*/
128130
public function getWithUniqueMainSnaks() {

tests/unit/Statement/StatementByGuidMapTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,28 @@ public function nonStringProvider() {
5656
);
5757
}
5858

59-
public function testGivenGuidOfPresentStatement_getStatementWithGuidReturnsStatement() {
59+
public function testGivenGuidOfPresentStatement_getStatementByGuidReturnsStatement() {
6060
$statement = $this->newStatement( 1, 'some guid' );
6161

6262
$statements = new StatementByGuidMap( array( $statement ) );
6363

64-
$this->assertEquals( $statement, $statements->getStatementWithGuid( 'some guid' ) );
64+
$this->assertEquals( $statement, $statements->getStatementByGuid( 'some guid' ) );
6565
}
6666

67-
public function testGivenGuidOfNotPresentStatement_getStatementWithGuidReturnsNull() {
67+
public function testGivenGuidOfNotPresentStatement_getStatementByGuidReturnsNull() {
6868
$statements = new StatementByGuidMap();
6969

70-
$this->assertNull( $statements->getStatementWithGuid( 'some guid' ) );
70+
$this->assertNull( $statements->getStatementByGuid( 'some guid' ) );
7171
}
7272

7373
/**
7474
* @dataProvider nonStringProvider
7575
*/
76-
public function testGivenNonStringGuid_getStatementWithGuidThrowsException( $nonString ) {
76+
public function testGivenNonStringGuid_getStatementByGuidThrowsException( $nonString ) {
7777
$statements = new StatementByGuidMap();
7878

7979
$this->setExpectedException( 'InvalidArgumentException' );
80-
$statements->getStatementWithGuid( $nonString );
80+
$statements->getStatementByGuid( $nonString );
8181
}
8282

8383
public function testGivenGuidOfPresentStatement_removeStatementWithGuidRemovesTheStatement() {
@@ -177,7 +177,7 @@ public function testGivenStatementWithPresentGuid_addStatementReplacesThePresent
177177

178178
$statements->addStatement( $statement2 );
179179

180-
$this->assertEquals( $statement2, $statements->getStatementWithGuid( 'some guid' ) );
180+
$this->assertEquals( $statement2, $statements->getStatementByGuid( 'some guid' ) );
181181
}
182182

183183
public function testToArray() {

0 commit comments

Comments
 (0)