Code Duplication    Length = 24-24 lines in 2 locations

Controller/CountryMappingController.php 1 location

@@ 29-52 (lines=24) @@
26
     *
27
     * @return Response
28
     */
29
    public function indexAction(Request $request)
30
    {
31
        $paginator  = $this->get('knp_paginator');
32
33
        /** @var EntityManager $em */
34
        $em = $this->get('doctrine')->getManager();
35
36
        $qb = $em->createQueryBuilder();
37
        $qb->select('c')
38
            ->from('LoevgaardPakkelabelsBundle:CountryMapping', 'c')
39
            ->orderBy('c.source')
40
        ;
41
42
        /** @var CountryMapping[] $countryMappings */
43
        $countryMappings = $paginator->paginate(
44
            $qb,
45
            $request->query->getInt('page', 1),
46
            30
47
        );
48
49
        return $this->render('@LoevgaardPakkelabels/country_mapping/index.html.twig', [
50
            'countryMappings' => $countryMappings,
51
        ]);
52
    }
53
54
    /**
55
     * @Method("GET")

Controller/LabelController.php 1 location

@@ 26-49 (lines=24) @@
23
     *
24
     * @return Response
25
     */
26
    public function indexAction(Request $request)
27
    {
28
        $paginator  = $this->get('knp_paginator');
29
30
        /** @var EntityManager $em */
31
        $em = $this->get('doctrine')->getManager();
32
33
        $qb = $em->createQueryBuilder();
34
        $qb->select('l')
35
            ->from('LoevgaardPakkelabelsBundle:Label', 'l')
36
            ->orderBy('l.id', 'desc')
37
        ;
38
39
        /** @var Label[] $labels */
40
        $labels = $paginator->paginate(
41
            $qb,
42
            $request->query->getInt('page', 1),
43
            100
44
        );
45
46
        return $this->render('@LoevgaardPakkelabels/label/index.html.twig', [
47
            'labels' => $labels,
48
        ]);
49
    }
50
51
    /**
52
     * @Method("GET")