Skip to content

Commit

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

Expand Down Expand Up @@ -100,6 +101,18 @@ $iterator->current();
// ['foo', ''foo']
```

### Set::forEach()

The `forEach()` method executes a provided function once per each element of the Set.

```php
$set = new Set([3, 0]);

$set->forEach(function (int $value1, int $value2, Set $set) {
// ...
});
```

### Set::has()

The `has()` method returns `TRUE` when element with the specified value exists in the `Set` or `FALSE` if it does not exist.
Expand Down

0 comments on commit fe5e145

Please sign in to comment.