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

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