| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | private function acquire(string $identifier, float $ttl = 360.0): bool |
||
| 24 | { |
||
| 25 | if ($this->lockFactory === null) { |
||
| 26 | return true; |
||
| 27 | } |
||
| 28 | |||
| 29 | $this->lock = $this->lockFactory->create($identifier, $ttl); |
||
| 30 | |||
| 31 | if (!$this->lock->acquire()) { |
||
| 32 | $this->lock = null; |
||
| 33 | return false; |
||
| 34 | } |
||
| 35 | |||
| 36 | return true; |
||
| 37 | } |
||
| 66 |