Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
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 | public function __construct(string $lockName, bool $isBlocking = false, float $ttl = self::DEFAULT_TTL) |
||
18 | { |
||
19 | $this->lockName = $lockName; |
||
20 | $this->isBlocking = $isBlocking; |
||
21 | $this->ttl = $ttl; |
||
22 | } |
||
23 | |||
24 | public function lockName(): string |
||
25 | { |
||
26 | return $this->lockName; |
||
27 | } |
||
28 | |||
29 | public function isBlocking(): bool |
||
30 | { |
||
31 | return $this->isBlocking; |
||
32 | } |
||
33 | |||
34 | public function ttl(): float |
||
37 | } |
||
38 | } |
||
39 |