Code Duplication    Length = 12-12 lines in 2 locations

src/PlaygroundGame/Controller/Admin/PrizeCategoryController.php 2 locations

@@ 63-74 (lines=12) @@
60
        $category = new PrizeCategory();
61
        $form->bind($category);
62
63
        if ($request->isPost()) {
64
            $data = array_merge(
65
                $request->getPost()->toArray(),
66
                $request->getFiles()->toArray()
67
            );
68
            $category = $this->getPrizeCategoryService()->create(
69
                $data,
70
                $category,
71
                'playgroundgame_prizecategory_form'
72
            );
73
            if ($category) {
74
                $this->flashMessenger()->setNamespace('playgroundgame')->addMessage('la catégorie a été créée');
75
76
                return $this->redirect()->toRoute('admin/playgroundgame/prize-category-list');
77
            }
@@ 97-108 (lines=12) @@
94
95
        $form->bind($category);
96
97
        if ($request->isPost()) {
98
            $data = array_merge(
99
                $request->getPost()->toArray(),
100
                $request->getFiles()->toArray()
101
            );
102
            $category = $this->getPrizeCategoryService()->edit(
103
                $data,
104
                $category,
105
                'playgroundgame_prizecategory_form'
106
            );
107
            if ($category) {
108
                $this->flashMessenger()->setNamespace('playgroundgame')->addMessage(
109
                    'La catégorie a été mise à jour'
110
                );
111