Code Duplication    Length = 16-16 lines in 2 locations

src/Infrastructure/Persistence/DoctrineORM/Repository/TaskRepository.php 2 locations

@@ 80-95 (lines=16) @@
77
    /**
78
     * @inheritDoc
79
     */
80
    public function save(Task $task): bool
81
    {
82
        try {
83
            $this->getEntityManager()->persist($task);
84
        } catch (ORMInvalidArgumentException $e) {
85
            return false;
86
        }
87
88
        try {
89
            $this->getEntityManager()->flush();
90
        } catch (OptimisticLockException $e) {
91
            return false;
92
        }
93
94
        return true;
95
    }
96
97
    /**
98
     * @inheritDoc
@@ 100-115 (lines=16) @@
97
    /**
98
     * @inheritDoc
99
     */
100
    public function remove(Task $task): bool
101
    {
102
        try {
103
            $this->getEntityManager()->remove($task);
104
        } catch (ORMInvalidArgumentException $e) {
105
            return false;
106
        }
107
108
        try {
109
            $this->getEntityManager()->flush();
110
        } catch (OptimisticLockException $e) {
111
            return false;
112
        }
113
114
        return true;
115
    }
116
117
    /**
118
     * @inheritDoc