Skip to content

Commit ddcce90

Browse files
committed
fix typo in README
1 parent e977e25 commit ddcce90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ This way you have the possibility to use them and extend it's behavior tailored
7474
use DCSG\ImmutableCollections\ImmutableCollection;
7575

7676
final class MyStringCollection extends ImmutableCollection {
77-
ImmutableCollection
7877
protected function validateItems(array $elements): void
7978
{
8079
foreach ($elements as $element) {
@@ -87,6 +86,7 @@ final class MyStringCollection extends ImmutableCollection {
8786

8887
$collection = MyStringCollection::create(['foo', 'bar']);
8988
echo $collection->count(); // 2
89+
$slicedCollection = $collection->slice(0, 1); // MyStringCollection { $elements=['foo']}
9090
```
9191

9292
###### Creating a Typed Set Collection
@@ -97,7 +97,6 @@ echo $collection->count(); // 2
9797
use DCSG\ImmutableCollections\SetImmutableCollection;
9898

9999
final class MyStringSetCollection extends SetImmutableCollection {
100-
ImmutableCollection
101100
protected function validateItems(array $elements): void
102101
{
103102
foreach ($elements as $element) {
@@ -110,6 +109,7 @@ final class MyStringSetCollection extends SetImmutableCollection {
110109

111110
$collection = MyStringSetCollection::create(['foo', 'bar']);
112111
echo $collection->count(); // 2
112+
$slicedCollection = $collection->tail(); // MyStringSetCollection { $elements=['bar']}
113113

114114
$collection = MyStringSetCollection::create(['foo', 'bar', 'foo']); // Throws InvalidArgumentException
115115
```

0 commit comments

Comments
 (0)