Skip to content

Commit

Permalink
docs: Added Set::keys() documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rudashi committed Sep 27, 2024
1 parent 811b237 commit 82cd6f5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 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::keys()`](#setkeys)
- [`Set::values()`](#setvalues)
- [`Set::size`](#setsize)

Expand Down Expand Up @@ -128,6 +129,20 @@ $set->has(6);
// false
```

### Set::keys()

The `keys()` method is exactly equivalent to the [values()](#setvalues) method.

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

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

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

### Set::values()

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

0 comments on commit 82cd6f5

Please sign in to comment.