Code Duplication    Length = 15-15 lines in 3 locations

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

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

@@ 262-276 (lines=15) @@
259
    /**
260
     * {@inheritdoc}
261
     */
262
    public function remove(ObjectInterface $object)
263
    {
264
        if (!$object instanceof ContentTypeObject) {
265
            throw new UnsupportedObjectOperationException(ContentTypeObject::class, get_class($object));
266
        }
267
268
        try {
269
            $contentType = $this->find($object);
270
            $this->contentTypeService->deleteContentType($contentType);
271
272
            return true;
273
        } catch (NotFoundException $notFound) {
274
            return false;
275
        }
276
    }
277
278
    /**
279
     * @param FieldDefinitionObject $field

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

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