| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function acquireLock(string $name): bool |
||
| 25 | { |
||
| 26 | $lockFileName = $this->getLockFileName($name); |
||
| 27 | |||
| 28 | if (!$this->hasLock($name) && !$this->connectionAdapter->exists($lockFileName)) |
||
| 29 | { |
||
| 30 | $this->connectionAdapter->write($lockFileName, $this->getLockLabel()); |
||
| 31 | |||
| 32 | $this->acquiredLocks[] = $name; |
||
| 33 | } |
||
| 34 | |||
| 35 | return $this->hasLock($name); |
||
| 36 | } |
||
| 37 | |||
| 55 |