Skip to content

Commit d856112

Browse files
committed
Rename getRel() to getRels(), as it returns an array.
1 parent a85a496 commit d856112

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/LinkCollectionTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getLinks()
3737
public function getLinksByRel($rel)
3838
{
3939
$filter = function (LinkInterface $link) use ($rel) {
40-
return in_array($rel, $link->getRel());
40+
return in_array($rel, $link->getRels());
4141
};
4242
return array_filter($this->links, $filter);
4343
}

src/LinkTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function isTemplated()
5858
/**
5959
* {@inheritdoc}
6060
*/
61-
public function getRel()
61+
public function getRels()
6262
{
6363
return array_keys($this->rel);
6464
}

test/LinkTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function test_can_set_and_retrieve_values()
1616
;
1717

1818
$this->assertEquals('http://www.google.com', $link->getHref());
19-
$this->assertContains('next', $link->getRel());
19+
$this->assertContains('next', $link->getRels());
2020
$this->assertArrayHasKey('me', $link->getAttributes());
2121
$this->assertEquals('you', $link->getAttributes()['me']);
2222
}
@@ -33,7 +33,7 @@ public function test_can_remove_values()
3333
->withoutRel('next');
3434

3535
$this->assertEquals('http://www.google.com', $link->getHref());
36-
$this->assertFalse(in_array('next', $link->getRel()));
36+
$this->assertFalse(in_array('next', $link->getRels()));
3737
$this->assertFalse(array_key_exists('me', $link->getAttributes()));
3838
}
3939

@@ -44,16 +44,16 @@ public function test_multiple_rels()
4444
->withRel('next')
4545
->withRel('reference');
4646

47-
$this->assertCount(2, $link->getRel());
48-
$this->assertContains('next', $link->getRel());
49-
$this->assertContains('reference', $link->getRel());
47+
$this->assertCount(2, $link->getRels());
48+
$this->assertContains('next', $link->getRels());
49+
$this->assertContains('reference', $link->getRels());
5050
}
5151

5252
public function test_constructor()
5353
{
5454
$link = new Link('next', 'http://www.google.com');
5555

5656
$this->assertEquals('http://www.google.com', $link->getHref());
57-
$this->assertContains('next', $link->getRel());
57+
$this->assertContains('next', $link->getRels());
5858
}
5959
}

0 commit comments

Comments
 (0)