Total Complexity | 2 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | final class Expiry |
||
8 | { |
||
9 | /** @var array<string, int> */ |
||
10 | private array $time; |
||
11 | |||
12 | 32 | public function __construct(int $short = 60, int $medium = 3600, int $long = 86400, int $never = 31_536_000) |
|
|
|||
13 | { |
||
14 | 32 | $this->time = [ |
|
15 | 32 | 'short' => $short, |
|
16 | 32 | 'medium' => $medium, |
|
17 | 32 | 'long' => $long, |
|
18 | 32 | 'never' => $never, |
|
19 | 32 | ]; |
|
20 | } |
||
21 | |||
22 | public function getTime(string $type): int |
||
23 | { |
||
24 | return $this->time[$type]; |
||
25 | } |
||
27 |