From f09ddb46b8f15e626541ac8fd4b29bd789b85454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 15 Mar 2020 13:40:04 +0100 Subject: [PATCH] Fixed PHPstan issue. --- src/Controller/PartController.php | 36 ------------------------------- 1 file changed, 36 deletions(-) diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php index 11ebd22f..8c9e695d 100644 --- a/src/Controller/PartController.php +++ b/src/Controller/PartController.php @@ -295,40 +295,4 @@ class PartController extends AbstractController 'attachment_helper' => $attachmentHelper, ]); } - - /** - * //@Route("/{id}/clone", name="part_clone") - * - * @param Part $part - * @param Request $request - * @param EntityManagerInterface $em - * @param TranslatorInterface $translator - * @return RedirectResponse|Response - */ - public function clone(Part $part, Request $request, EntityManagerInterface $em, TranslatorInterface $translator) - { - /** @var Part $new_part */ - $new_part = clone $part; - - $this->denyAccessUnlessGranted('create', $new_part); - - $form = $this->createForm(PartBaseType::class, $new_part); - - $form->handleRequest($request); - - if ($form->isSubmitted() && $form->isValid()) { - $em->persist($new_part); - $em->flush(); - $this->addFlash('success', 'part.created_flash'); - - return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); - } - - return $this->render('Parts/edit/new_part.html.twig', - [ - 'part' => $new_part, - 'form' => $form->createView(), - 'attachment_helper' => $attachmentHelper, - ]); - } }