Skip to content

Commit 1a07821

Browse files
authored
Merge pull request #1 from php-fig/provider
Rename collection to provider
2 parents d856112 + 0fceacf commit 1a07821

File tree

5 files changed

+26
-29
lines changed

5 files changed

+26
-29
lines changed

composer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,5 @@
3131
"branch-alias": {
3232
"dev-master": "1.0.x-dev"
3333
}
34-
},
35-
"repositories": [
36-
{ "type": "path", "url": "../link" }
37-
]
34+
}
3835
}

src/EvolvableLinkCollectionTrait.php renamed to src/EvolvableLinkProviderTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
namespace Fig\Link;
44

55
use Psr\Link\LinkInterface;
6-
use Psr\Link\EvolvableLinkCollectionInterface;
6+
use Psr\Link\EvolvableLinkProviderInterface;
77

88
/**
9-
* Class EvolvableLinkCollectionTrait
9+
* Class EvolvableLinkProviderTrait
1010
*
11-
* @implements EvolvableLinkCollectionInterface
11+
* @implements EvolvableLinkProviderInterface
1212
*/
13-
trait EvolvableLinkCollectionTrait
13+
trait EvolvableLinkProviderTrait
1414
{
15-
use LinkCollectionTrait;
15+
use LinkProviderTrait;
1616

1717
/**
1818
* {@inheritdoc}

src/GenericLinkCollection.php renamed to src/GenericLinkProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
namespace Fig\Link;
44

5-
use Psr\Link\EvolvableLinkCollectionInterface;
5+
use Psr\Link\EvolvableLinkProviderInterface;
66
use Psr\Link\LinkInterface;
77

8-
class GenericLinkCollection implements EvolvableLinkCollectionInterface
8+
class GenericLinkProvider implements EvolvableLinkProviderInterface
99
{
10-
use EvolvableLinkCollectionTrait;
10+
use EvolvableLinkProviderTrait;
1111

1212
/**
13-
* Constructs a new link collection.
13+
* Constructs a new link provider.
1414
*
1515
* @param LinkInterface[] $links
16-
* Optionally, specify an initial set of links for this collection.
16+
* Optionally, specify an initial set of links for this provider.
1717
* Note that the keys of the array will be ignored.
1818
*/
1919
public function __construct(array $links = [])

src/LinkCollectionTrait.php renamed to src/LinkProviderTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33

44
namespace Fig\Link;
55

6-
use Psr\Link\LinkCollectionInterface;
6+
use Psr\Link\LinkProviderInterface;
77
use Psr\Link\LinkInterface;
88

99
/**
10-
* Class LinkCollectionTrait
10+
* Class LinkProviderTrait
1111
*
12-
* @implements LinkCollectionInterface
12+
* @implements LinkProviderInterface
1313
*/
14-
trait LinkCollectionTrait
14+
trait LinkProviderTrait
1515
{
1616
/**
17-
* A collection of the links in this collection.
17+
* An array of the links in this provider.
1818
*
1919
* The keys of the array MUST be the spl_object_hash() of the object being stored.
2020
* That helps to ensure uniqueness.

test/GenericLinkCollectionTest.php renamed to test/GenericLinkProviderTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
namespace Fig\Link\Tests;
55

6-
use Fig\Link\GenericLinkCollection;
6+
use Fig\Link\GenericLinkProvider;
77
use Fig\Link\Link;
88

9-
class GenericLinkCollectionTest extends \PHPUnit_Framework_TestCase
9+
class GenericLinkProviderTest extends \PHPUnit_Framework_TestCase
1010
{
1111

1212
public function test_can_add_links_by_method()
@@ -17,10 +17,10 @@ public function test_can_add_links_by_method()
1717
->withAttribute('me', 'you')
1818
;
1919

20-
$collection = (new GenericLinkCollection())
20+
$provider = (new GenericLinkProvider())
2121
->withLink($link);
2222

23-
$this->assertContains($link, $collection->getLinks());
23+
$this->assertContains($link, $provider->getLinks());
2424
}
2525

2626

@@ -32,10 +32,10 @@ public function test_can_add_links_by_constructor()
3232
->withAttribute('me', 'you')
3333
;
3434

35-
$collection = (new GenericLinkCollection())
35+
$provider = (new GenericLinkProvider())
3636
->withLink($link);
3737

38-
$this->assertContains($link, $collection->getLinks());
38+
$this->assertContains($link, $provider->getLinks());
3939
}
4040

4141
public function test_can_get_links_by_rel()
@@ -51,11 +51,11 @@ public function test_can_get_links_by_rel()
5151
->withAttribute('me', 'you')
5252
;
5353

54-
$collection = (new GenericLinkCollection())
54+
$provider = (new GenericLinkProvider())
5555
->withLink($link1)
5656
->withLink($link2);
5757

58-
$links = $collection->getLinksByRel('home');
58+
$links = $provider->getLinksByRel('home');
5959
$this->assertContains($link2, $links);
6060
$this->assertFalse(in_array($link1, $links));
6161
}
@@ -68,10 +68,10 @@ public function test_can_remove_links()
6868
->withAttribute('me', 'you')
6969
;
7070

71-
$collection = (new GenericLinkCollection())
71+
$provider = (new GenericLinkProvider())
7272
->withLink($link)
7373
->withoutLink($link);
7474

75-
$this->assertFalse(in_array($link, $collection->getLinks()));
75+
$this->assertFalse(in_array($link, $provider->getLinks()));
7676
}
7777
}

0 commit comments

Comments
 (0)