Skip to content

Commit

Permalink
docs: Added Set::values() documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rudashi committed Sep 26, 2024
1 parent 7e206cf commit 2994a95
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/Set.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The Set object holds only unique values of any type.
- [`Set::entries()`](#setentries)
- [`Set::forEach()`](#setforeach)
- [`Set::has()`](#sethas)
- [`Set::values()`](#setvalues)
- [`Set::size`](#setsize)

## Constructor
Expand Down Expand Up @@ -127,6 +128,23 @@ $set->has(6);
// false
```

### Set::values()

The `values()` method returns a new `SetIterator` instance that contain the values of each element of the Set.

```php
$set = new Set(['foo', 'bar']);

$iterator = $set->values();
// [object SetIterator]

$iterator->current();
// 'foo'

$iterator->next();
// 'bar'
```

## Properties

### Set::size
Expand Down

0 comments on commit 2994a95

Please sign in to comment.