-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSessionInterface.php
More file actions
71 lines (62 loc) · 1.57 KB
/
Copy pathSessionInterface.php
File metadata and controls
71 lines (62 loc) · 1.57 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
<?php
namespace Odan\Session;
/**
* The session data operations.
*/
interface SessionInterface
{
/**
* Gets an attribute by key.
*
* @param string $key The key name or null to get all values
* @param mixed $default The default value
*
* @return mixed The value. Returns null if the key is not found
*/
public function get(string $key, mixed $default = null): mixed;
/**
* Gets all values as array.
*
* @return array<string, mixed> The session values
*/
public function all(): array;
/**
* Sets an attribute by key.
*
* @param string $key The key of the element to set
* @param mixed $value The data to set
*
* @return void
*/
public function set(string $key, mixed $value): void;
/**
* Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
*
* @param array<string, mixed> $values The new values
*/
public function setValues(array $values): void;
/**
* Check if an attribute key exists.
*
* @param string $key The key
*
* @return bool True if the key is set or not
*/
public function has(string $key): bool;
/**
* Deletes an attribute by key.
*
* @param string $key The key to remove
*/
public function delete(string $key): void;
/**
* Clear all attributes.
*/
public function clear(): void;
/**
* Get flash handler.
*
* @return FlashInterface The flash handler
*/
public function getFlash(): FlashInterface;
}