Skip to content

Commit 97d670b

Browse files
committed
docs: Added Set::delete() documentation
1 parent 0b81b20 commit 97d670b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/Set.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The Set object holds only unique values of any type.
66

77
- [`Set() constructor`](#new-set)
88
- [`Set::add()`](#setadd)
9+
- [`Set::delete()`](#setdelete)
910
- [`Set::has()`](#sethas)
1011

1112
## Constructor
@@ -52,6 +53,20 @@ $set->add(40)->add('second');
5253
// [40, 'first', 'second']
5354
```
5455

56+
### Set::delete()
57+
58+
The `delete()` method removes a specified value from the Set.
59+
60+
```php
61+
$set = new Set(['foo', 'bar']);
62+
63+
$set->delete('foo');
64+
// true
65+
66+
$set->delete(1);
67+
// false
68+
```
69+
5570
### Set::has()
5671

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

0 commit comments

Comments
 (0)