Total Complexity | 7 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 71.43% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class SessionHandler implements SessionHandlerInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var Session |
||
22 | */ |
||
23 | private $_session; |
||
24 | |||
25 | 2 | public function __construct(Session $session) |
|
26 | { |
||
27 | 2 | $this->_session = $session; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @inheritDoc |
||
32 | */ |
||
33 | 2 | public function close(): bool |
|
34 | { |
||
35 | 2 | return $this->_session->closeSession(); |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @inheritDoc |
||
40 | */ |
||
41 | public function destroy($id): bool |
||
42 | { |
||
43 | return $this->_session->destroySession($id); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @inheritDoc |
||
48 | */ |
||
49 | #[\ReturnTypeWillChange] |
||
50 | public function gc($max_lifetime) |
||
51 | { |
||
52 | return $this->_session->gcSession($max_lifetime); |
||
|
|||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @inheritDoc |
||
57 | */ |
||
58 | 3 | public function open($path, $name): bool |
|
59 | { |
||
60 | 3 | return $this->_session->openSession($path, $name); |
|
61 | } |
||
62 | |||
63 | /** |
||
64 | * @inheritDoc |
||
65 | */ |
||
66 | 3 | #[\ReturnTypeWillChange] |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * @inheritDoc |
||
74 | */ |
||
75 | 2 | public function write($id, $data): bool |
|
80 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: