Code Duplication    Length = 7-8 lines in 2 locations

src/AppBundle/Controller/BandController.php 1 location

@@ 246-253 (lines=8) @@
243
                $bandMemberRepository = $this->get('rockparade.band_member_repository');
244
                $bandMember = $bandMemberRepository->findByAmbassadorAndUser($band, $user);
245
246
                if ($bandMember) {
247
                    $band->removeMember($bandMember);
248
                    $bandRepository->flush();
249
250
                    $response = new EmptyApiResponse(Response::HTTP_NO_CONTENT);
251
                } else {
252
                    $response = $this->createEntityNotFoundResponse(BandMember::class, $userLogin);
253
                }
254
            } else {
255
                $response = $this->createEntityNotFoundResponse(User::class, $userLogin);
256
            }

src/AppBundle/Controller/EventController.php 1 location

@@ 334-340 (lines=7) @@
331
            } else {
332
                $image = $imageRepository->findOneById($imageId);
333
334
                if ($image) {
335
                    $event->removeImage($image);
336
                    $eventRepository->flush();
337
                    $response = new EmptyApiResponse(Response::HTTP_OK);
338
                } else {
339
                    $response = $entityService->createEntityNotFoundResponse(Image::class, $imageId);
340
                }
341
            }
342
        } else {
343
            $response = $entityService->createEntityNotFoundResponse(Event::class, $id);