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