Completed
Push — psalm ( 804131 )
by Akihito
01:07
created

Expiry::getTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\QueryRepository;
6
7
use ArrayObject;
8
9
final class Expiry
10
{
11
    /**
12
     * @var array<string, int>
13
     */
14
    private $time;
15
16
    public function __construct(int $short = 60, int $medium = 3600, int $long = 86400, int $never = 31536000)
17
    {
18
        $this->time = [
19
            'short' => $short,
20
            'medium' => $medium,
21
            'long' => $long,
22
            'never' => $never
23
        ];
24
    }
25
26
    public function getTime(string $type): int
27
    {
28
        return $this->time[$type];
29
    }
30
}
31