Code Duplication    Length = 15-15 lines in 3 locations

src/Transfer/EzPlatform/Repository/Manager/ContentManager.php 1 location

@@ 209-223 (lines=15) @@
206
    /**
207
     * {@inheritdoc}
208
     */
209
    public function remove(ObjectInterface $object)
210
    {
211
        if (!$object instanceof ContentObject) {
212
            throw new UnsupportedObjectOperationException(ContentObject::class, get_class($object));
213
        }
214
215
        try {
216
            $content = $this->find($object);
217
            $this->contentService->deleteContent($content->contentInfo);
218
219
            return true;
220
        } catch (NotFoundException $notFound) {
221
            return false;
222
        }
223
    }
224
225
    /**
226
     * Assigns a main location ID for a content object.

src/Transfer/EzPlatform/Repository/Manager/ContentTypeManager.php 1 location

@@ 243-257 (lines=15) @@
240
    /**
241
     * {@inheritdoc}
242
     */
243
    public function remove(ObjectInterface $object)
244
    {
245
        if (!$object instanceof ContentTypeObject) {
246
            throw new UnsupportedObjectOperationException(ContentTypeObject::class, get_class($object));
247
        }
248
249
        try {
250
            $contentType = $this->find($object);
251
            $this->contentTypeService->deleteContentType($contentType);
252
253
            return true;
254
        } catch (NotFoundException $notFound) {
255
            return false;
256
        }
257
    }
258
259
    /**
260
     * @param FieldDefinitionObject $field

src/Transfer/EzPlatform/Repository/Manager/UserGroupManager.php 1 location

@@ 198-212 (lines=15) @@
195
    /**
196
     * {@inheritdoc}
197
     */
198
    public function remove(ObjectInterface $object)
199
    {
200
        if (!$object instanceof UserGroupObject) {
201
            throw new UnsupportedObjectOperationException(UserGroupObject::class, get_class($object));
202
        }
203
204
        try {
205
            $userGroup = $this->find($object);
206
            $this->userService->deleteUserGroup($userGroup);
207
208
            return true;
209
        } catch (NotFoundException $notFound) {
210
            return false;
211
        }
212
    }
213
}
214