-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathCollectionInterface.php
More file actions
74 lines (63 loc) · 1.54 KB
/
Copy pathCollectionInterface.php
File metadata and controls
74 lines (63 loc) · 1.54 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
declare(strict_types=1);
namespace Bow\Contracts;
interface CollectionInterface
{
/**
* Check for existence of a key in the session collection
*
* @param string|int $key
* @return bool
*/
public function has(string|int $key): bool;
/**
* Check if a collection is empty.
*
* @return bool
*/
public function isEmpty(): bool;
/**
* Allows to recover a value or value collection.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
public function get(mixed $key, mixed $default = null): mixed;
/**
* Add an entry to the collection
*
* @param string|int $key
* @param mixed $data
* @param bool $next
* @return CollectionInterface
*/
public function add(string|int $key, mixed $data, bool $next = false): mixed;
/**
* Delete an entry in the collection
*
* @param string|int $key
* @return CollectionInterface
*/
public function remove(string|int $key): mixed;
/**
* Modify an entry in the collection
*
* @param string $key
* @param mixed $value
* @return CollectionInterface
*/
public function set(string $key, mixed $value): mixed;
/**
* Return all the entries of the collection as an array
*
* @return array
*/
public function toArray(): array;
/**
* Return all entries of the collection as an object
*
* @return array
*/
public function toObject(): array;
}