Code Duplication    Length = 12-12 lines in 2 locations

src/Governor/Framework/Repository/LockingRepository.php 2 locations

@@ 31-42 (lines=12) @@
28
        $this->lockManager = $lockManager;
29
    }
30
31
    public function add(AggregateRootInterface $object)
32
    {
33
        $aggregateId = $object->getIdentifier();
34
        $this->lockManager->obtainLock($aggregateId);
35
36
        try {
37
            parent::add($object);
38
        } catch (\Exception $ex) {
39
            $this->lockManager->releaseLock($aggregateId);
40
            throw $ex;
41
        }
42
    }
43
44
    public function load($id, $expectedVersion = null)
45
    {
@@ 44-55 (lines=12) @@
41
        }
42
    }
43
44
    public function load($id, $expectedVersion = null)
45
    {
46
        $this->lockManager->obtainLock($id);
47
        try {
48
            $object = parent::load($id, $expectedVersion);
49
50
            return $object;
51
        } catch (\Exception $ex) {
52
            $this->lockManager->releaseLock($id);
53
            throw $ex;
54
        }
55
    }
56
57
    protected function doDelete(AggregateRootInterface $object)
58
    {