Code Duplication    Length = 18-18 lines in 2 locations

src/Badger/Bundle/GameBundle/Controller/QuestController.php 1 location

@@ 89-106 (lines=18) @@
86
     *
87
     * @return RedirectResponse|Response
88
     */
89
    public function editAction(Request $request, $id)
90
    {
91
        $quest = $this->get('badger.game.repository.quest')->find($id);
92
        $editForm = $this->createForm(QuestType::class, $quest);
93
        $editForm->handleRequest($request);
94
95
        if ($editForm->isSubmitted() && $editForm->isValid()) {
96
            $questSaver = $this->get('badger.game.saver.quest');
97
            $questSaver->save($quest);
98
99
            return $this->redirectToRoute('admin_quest_edit', ['id' => $quest->getId()]);
100
        }
101
102
        return $this->render('@Game/quests/edit.html.twig', [
103
            'quest'       => $quest,
104
            'edit_form'   => $editForm->createView(),
105
        ]);
106
    }
107
108
    /**
109
     * Deletes a Quest entity.

src/Badger/Bundle/GameBundle/Controller/TagController.php 1 location

@@ 86-103 (lines=18) @@
83
     *
84
     * @return RedirectResponse|Response
85
     */
86
    public function editAction(Request $request, Tag $tag)
87
    {
88
        $editForm = $this->createForm('Badger\Bundle\GameBundle\Form\TagType', $tag);
89
        $editForm->remove('createdAt');
90
        $editForm->handleRequest($request);
91
92
        if ($editForm->isSubmitted() && $editForm->isValid()) {
93
            $tagSaver = $this->get('badger.game.saver.tag');
94
            $tagSaver->save($tag);
95
96
            return $this->redirectToRoute('admin_tag_edit', ['id' => $tag->getId()]);
97
        }
98
99
        return $this->render('@Game/tag/edit.html.twig', [
100
            'tag' => $tag,
101
            'edit_form' => $editForm->createView(),
102
        ]);
103
    }
104
105
    /**
106
     * Deletes a Tag entity.