Skip to content

Commit 2994a95

Browse files
committed
docs: Added Set::values() documentation
1 parent 7e206cf commit 2994a95

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/Set.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The Set object holds only unique values of any type.
1111
- [`Set::entries()`](#setentries)
1212
- [`Set::forEach()`](#setforeach)
1313
- [`Set::has()`](#sethas)
14+
- [`Set::values()`](#setvalues)
1415
- [`Set::size`](#setsize)
1516

1617
## Constructor
@@ -127,6 +128,23 @@ $set->has(6);
127128
// false
128129
```
129130

131+
### Set::values()
132+
133+
The `values()` method returns a new `SetIterator` instance that contain the values of each element of the Set.
134+
135+
```php
136+
$set = new Set(['foo', 'bar']);
137+
138+
$iterator = $set->values();
139+
// [object SetIterator]
140+
141+
$iterator->current();
142+
// 'foo'
143+
144+
$iterator->next();
145+
// 'bar'
146+
```
147+
130148
## Properties
131149

132150
### Set::size

0 commit comments

Comments
 (0)