Code Duplication    Length = 9-10 lines in 2 locations

src/AppBundle/Controller/CampaignApiController.php 1 location

@@ 429-438 (lines=10) @@
426
     *     }
427
     * )
428
     */
429
    public function deleteCampaignAction(Campaign $campaign, Request $request)
430
    {
431
        $project = $campaign->getProject();
432
        if ($this->isInvalidToken($request, $project->getToken())) {
433
            return $this->getInvalidTokenView();
434
        }
435
        $em = $this->getDoctrine()->getManager();
436
        $em->remove($campaign);
437
        $em->flush();
438
    }
439
}
440

src/AppBundle/Controller/ProjectApiController.php 1 location

@@ 359-367 (lines=9) @@
356
     *     }
357
     * )
358
     */
359
    public function deleteProjectAction(Project $project, Request $request)
360
    {
361
        if ($this->isInvalidToken($request, $project->getToken())) {
362
            return $this->getInvalidTokenView();
363
        }
364
        $em = $this->getDoctrine()->getManager();
365
        $em->remove($project);
366
        $em->flush();
367
    }
368
}
369