Code Duplication    Length = 17-17 lines in 2 locations

src/Controller/RefillController.php 2 locations

@@ 49-65 (lines=17) @@
46
     *
47
     * @return Response
48
     */
49
    public function refillAction($plugin, $field, Request $request)
50
    {
51
        /* @var $refiller RefillerInterface */
52
        if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
53
            throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
54
        }
55
        $item = $this->createForm('anime_db_catalog_entity_item', new Item())
56
            ->handleRequest($request)
57
            ->getData();
58
59
        $form = $this->getForm($field, clone $item, $refiller->refill($item, $field));
60
61
        return $this->render('AnimeDbCatalogBundle:Refill:refill.html.twig', [
62
            'field' => $field,
63
            'form' => $form->createView(),
64
        ]);
65
    }
66
67
    /**
68
     * Search for refill
@@ 121-137 (lines=17) @@
118
     *
119
     * @return Response
120
     */
121
    public function fillFromSearchAction($plugin, $field, Request $request)
122
    {
123
        /* @var $refiller RefillerInterface */
124
        if (!($refiller = $this->get('anime_db.plugin.refiller')->getPlugin($plugin))) {
125
            throw $this->createNotFoundException('Plugin \''.$plugin.'\' is not found');
126
        }
127
        $item = $this->createForm('anime_db_catalog_entity_item', new Item())
128
            ->handleRequest($request)
129
            ->getData();
130
131
        $form = $this->getForm($field, clone $item, $refiller->refillFromSearchResult($item, $field, $request->get('data')));
132
133
        return $this->render('AnimeDbCatalogBundle:Refill:refill.html.twig', [
134
            'field' => $field,
135
            'form' => $form->createView(),
136
        ]);
137
    }
138
139
    /**
140
     * Get form for field