| Total Complexity | 4 |
| Total Lines | 71 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | abstract class AbstractAdapter |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var mixed instance of Redis or Cache or some other |
||
| 23 | */ |
||
| 24 | protected $handler = null; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string prefix for session store |
||
| 28 | */ |
||
| 29 | protected $prefix = 'PHPSESSID:'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var integer TTL of session |
||
| 33 | */ |
||
| 34 | protected $ttl = 1800; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Prepare Id - add prefix |
||
| 38 | * |
||
| 39 | * @param string $id |
||
| 40 | * |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | protected function prepareId($id): string |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Initialize session |
||
| 50 | * |
||
| 51 | * @param string $savePath |
||
| 52 | * @param string $sessionName |
||
| 53 | * |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public function open($savePath, $sessionName): bool |
||
|
|
|||
| 57 | { |
||
| 58 | $this->prefix = $sessionName . ':'; |
||
| 59 | $this->ttl = (int)ini_get('session.gc_maxlifetime'); |
||
| 60 | |||
| 61 | // No more action necessary because connection is injected |
||
| 62 | // in constructor and arguments are not applicable. |
||
| 63 | |||
| 64 | return true; |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Close the session |
||
| 69 | * |
||
| 70 | * @return bool |
||
| 71 | */ |
||
| 72 | public function close(): bool |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * Cleanup old sessions |
||
| 81 | * |
||
| 82 | * @param integer $maxLifetime |
||
| 83 | * |
||
| 84 | * @return bool |
||
| 85 | */ |
||
| 86 | public function gc($maxLifetime): bool |
||
| 92 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.