Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | final class LockedCommandConfig |
||
7 | { |
||
8 | private const DEFAULT_TTL = 90.0; // 1.5 minutes |
||
9 | |||
10 | /** @var string */ |
||
11 | private $lockName; |
||
12 | /** @var bool */ |
||
13 | private $isBlocking; |
||
14 | /** @var float */ |
||
15 | private $ttl; |
||
16 | |||
17 | 11 | public function __construct(string $lockName, bool $isBlocking = false, float $ttl = self::DEFAULT_TTL) |
|
18 | { |
||
19 | 11 | $this->lockName = $lockName; |
|
20 | 11 | $this->isBlocking = $isBlocking; |
|
21 | 11 | $this->ttl = $ttl; |
|
22 | } |
||
23 | |||
24 | 11 | public function lockName(): string |
|
25 | { |
||
26 | 11 | return $this->lockName; |
|
27 | } |
||
28 | |||
29 | 11 | public function isBlocking(): bool |
|
30 | { |
||
31 | 11 | return $this->isBlocking; |
|
32 | } |
||
33 | |||
34 | 11 | public function ttl(): float |
|
37 | } |
||
38 | } |
||
39 |