-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWritableContainerInterface.php
58 lines (52 loc) · 1.62 KB
/
WritableContainerInterface.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
55
56
57
58
<?php
declare(strict_types=1);
namespace Dhii\Collection;
use Exception;
/**
* A container that can be written to.
*/
interface WritableContainerInterface extends ContainerInterface
{
/**
* Creates a new instance with the specified mappings.
*
* @since [*next-version*]
*
* @param array<string, mixed> $mappings A map of keys to values.
*
* @return static A new instance of this class with only the specified key-value mappings.
*
* @throws Exception If problem creating.
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function withMappings(array $mappings): WritableContainerInterface;
/**
* Creates a new instance with the specified mappings added to existing ones.
*
* @since [*next-version*]
*
* @param array<string, mixed> $mappings A map of keys to values.
*
* @return static A new instance of this class with the specified key-value mappings added to existing ones.
*
* @throws Exception If problem creating.
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function withAddedMappings(array $mappings): WritableContainerInterface;
/**
* Creates a new instance with the specified keys not present.
*
* @since [*next-version*]
*
* @param array<string> $keys The keys to exclude.
*
* @return static A new instance of this class which does not contain the specified keys.
*
* @throws Exception If problem instantiating.
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function withoutKeys(array $keys): WritableContainerInterface;
}