-
Notifications
You must be signed in to change notification settings - Fork 0
/
WritableSetInterface.php
54 lines (48 loc) · 1.4 KB
/
WritableSetInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
declare(strict_types=1);
namespace Dhii\Collection;
use Exception;
/**
* A set that can have items added.
*
* @psalm-suppress UnusedClass
*/
interface WritableSetInterface extends SetInterface
{
/**
* Creates a new instance with the given items only.
*
* @param array|mixed[] $items A list of items for the set.
*
* @return static A new instance of this class with only the given items.
*
* @throws Exception If problem creating.
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function withItems(array $items);
/**
* Creates a new instance with the given items added to existing ones.
*
* @param array|mixed[] $items A list of items to add.
*
* @return static A new instance of this class with the given items added to existing ones.
*
* @throws Exception If problem creating.
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function withAddedItems(array $items): WritableSetInterface;
/**
* Creates a new instance with the given items not present.
*
* @param array|mixed[] $items A list of items to exclude.
*
* @return static An instance of this class without the given items.
*
* @throws Exception If problem creating.
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function withoutItems(array $items): WritableSetInterface;
}