| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | 2 | private function executeWithLock(callable $fn): void |
|
| 62 | { |
||
| 63 | 2 | $this->manager->transactional( |
|
| 64 | function () use ($fn) { |
||
| 65 | 2 | $this->manager->lock($this->metric, LockMode::PESSIMISTIC_WRITE); |
|
| 66 | |||
| 67 | 2 | $this->manager->refresh($this->metric); |
|
| 68 | |||
| 69 | 2 | $fn(); |
|
| 70 | |||
| 71 | 2 | $this->manager->flush(); |
|
| 72 | 2 | } |
|
| 76 |