1 | <?php |
||
13 | class SessionBag extends ValueBag |
||
14 | { |
||
15 | public function __construct() |
||
19 | |||
20 | /** |
||
21 | * Get true if the SESSION parameter is defined. |
||
22 | * |
||
23 | * @param string $key |
||
24 | * @return bool true |
||
25 | */ |
||
26 | public function has(string $key): bool |
||
30 | |||
31 | /** |
||
32 | * Get the SESSION keys. |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | public function keys(): array |
||
40 | |||
41 | /** |
||
42 | * @param string $key |
||
43 | * @param mixed $value |
||
44 | * @throws \LogicException |
||
45 | */ |
||
46 | public function set($key, $value) |
||
54 | |||
55 | /** |
||
56 | * Returns a SESSION parameter by name. |
||
57 | * |
||
58 | * @param string $key |
||
59 | * @param mixed|null $default The default value if parameter does not exist |
||
60 | * @return mixed|null |
||
61 | */ |
||
62 | public function fetch(string $key, $default = null) |
||
66 | |||
67 | /** |
||
68 | * Returns the number of values. |
||
69 | * @return int |
||
70 | */ |
||
71 | public function count(): int |
||
75 | } |