Total Complexity | 5 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
20 | class SessionManager implements StorageManager |
||
21 | { |
||
22 | // @todo improve security |
||
23 | function __construct() |
||
|
|||
24 | { |
||
25 | session_start(); |
||
26 | } |
||
27 | |||
28 | function set($key, $value) |
||
29 | { |
||
30 | $_SESSION[$key] = serialize($value); |
||
31 | } |
||
32 | |||
33 | function get($key) |
||
34 | { |
||
35 | return unserialize($_SESSION[$key]); |
||
36 | } |
||
37 | |||
38 | function has($key) |
||
41 | } |
||
42 | |||
43 | function unset($key) |
||
46 | } |
||
47 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.