Code Duplication    Length = 12-13 lines in 2 locations

src/PlaygroundGame/Mapper/AbstractMapper.php 2 locations

@@ 69-80 (lines=12) @@
66
        return $this->persist($entity);
67
    }
68
69
    public function insert($entity)
70
    {
71
        try {
72
            $entity = $this->persist($entity);
73
        } catch (DBALException $e) {
74
            throw $e;
75
        } catch (\Exception $e) {
76
            throw $e;
77
        }
78
79
        return $entity;
80
    }
81
82
    protected function persist($entity)
83
    {
@@ 82-94 (lines=13) @@
79
        return $entity;
80
    }
81
82
    protected function persist($entity)
83
    {
84
        try {
85
            $this->em->persist($entity);
86
            $this->em->flush();
87
        } catch (DBALException $e) {
88
            throw $e;
89
        } catch (\Exception $e) {
90
            throw $e;
91
        }
92
93
        return $entity;
94
    }
95
96
    public function remove($entity)
97
    {