| Total Complexity | 7 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Sesion |
||
| 11 | { |
||
| 12 | public function __construct( |
||
| 13 | SesionId $sesionId |
||
| 14 | ) { |
||
| 15 | $this->setSesionId($sesionId->id()); |
||
| 16 | $this->setCreacion(); |
||
| 17 | $this->setCaducidad(); |
||
| 18 | } |
||
| 19 | |||
| 20 | public function id(): string |
||
| 21 | { |
||
| 22 | return $_SESSION[SESSION_ID]; |
||
| 23 | } |
||
| 24 | |||
| 25 | public function creacion(): int |
||
| 26 | { |
||
| 27 | return $_SESSION[SESSION_CREACION]; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function caducidad(): int |
||
| 33 | } |
||
| 34 | |||
| 35 | private function setSesionId(string $id): string |
||
| 36 | { |
||
| 37 | $_SESSION[SESSION_ID] = (string) $id; |
||
| 38 | |||
| 39 | return $_SESSION[SESSION_ID]; |
||
| 40 | } |
||
| 41 | |||
| 42 | private function setCreacion(): int |
||
| 43 | { |
||
| 44 | $_SESSION[SESSION_CREACION] = time(); |
||
| 45 | |||
| 46 | return $_SESSION[SESSION_CREACION]; |
||
| 47 | } |
||
| 48 | |||
| 49 | private function setCaducidad(): int |
||
| 54 | } |
||
| 55 | } |
||
| 56 |