Skip to content

Commit 559baea

Browse files
committed
docs: Added Set::isSupersetOf() documentation
1 parent f9af47b commit 559baea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/Set.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The Set object holds only unique values of any type.
1414
- [`Set::has()`](#sethas)
1515
- [`Set::intersection()`](#setintersection)
1616
- [`Set::isSubsetOf()`](#setissubsetof)
17+
- [`Set::isSupersetOf()`](#setissupersetof)
1718
- [`Set::keys()`](#setkeys)
1819
- [`Set::union()`](#setunion)
1920
- [`Set::values()`](#setvalues)
@@ -169,6 +170,18 @@ $fours->isSubsetOf($evens);
169170
// true
170171
```
171172

173+
### Set::isSupersetOf()
174+
175+
The `isSupersetOf()` method checks if all elements of the given Set are in the Set.
176+
177+
```php
178+
$evens = new Set([2, 4, 6, 8, 10, 12, 14, 16, 18]);
179+
$fours = new Set([4, 8, 12, 16]);
180+
181+
$evens->isSupersetOf($fours);
182+
// true
183+
```
184+
172185
### Set::keys()
173186

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

0 commit comments

Comments
 (0)