1 | <?php |
||
12 | class DatabaseSessionHandler implements \SessionHandlerInterface { |
||
13 | |||
14 | /** @var \Elgg\Database $db */ |
||
15 | protected $db; |
||
16 | |||
17 | /** |
||
18 | * Constructor |
||
19 | * |
||
20 | * @param \Elgg\Database $db The database |
||
21 | */ |
||
22 | public function __construct(\Elgg\Database $db) { |
||
25 | |||
26 | /** |
||
27 | * {@inheritDoc} |
||
28 | */ |
||
29 | public function open($save_path, $name) { |
||
32 | |||
33 | /** |
||
34 | * {@inheritDoc} |
||
35 | */ |
||
36 | public function read($session_id) { |
||
47 | |||
48 | /** |
||
49 | * {@inheritDoc} |
||
50 | */ |
||
51 | public function write($session_id, $session_data) { |
||
76 | |||
77 | /** |
||
78 | * {@inheritDoc} |
||
79 | */ |
||
80 | public function close() { |
||
83 | |||
84 | /** |
||
85 | * {@inheritDoc} |
||
86 | */ |
||
87 | public function destroy($session_id) { |
||
93 | |||
94 | /** |
||
95 | * {@inheritDoc} |
||
96 | */ |
||
97 | public function gc($max_lifetime) { |
||
103 | } |
||
104 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.