Code Duplication    Length = 14-15 lines in 2 locations

src/AppBundle/Controller/InventoryController.php 1 location

@@ 47-61 (lines=15) @@
44
     * @param \Symfony\Component\HttpFoundation\Request $request Paginate request
45
     * @return array
46
     */
47
    public function indexAction(Request $request)
48
    {
49
        $item = $this->container->getParameter('knp_paginator.page_range');
50
        $etm = $this->getDoctrine()->getManager();
51
        $qbd = $etm->getRepository('AppBundle:Inventory')->getInventory();
52
        
53
        $createForm = $this->createCreateForm('inventory_create');
54
55
        $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), $item);
56
57
        return array(
58
            'paginator' => $paginator,
59
            'create_form' => $createForm->createView(),
60
        );
61
    }
62
63
    /**
64
     * Finds and displays a Inventory entity.

src/AppBundle/Controller/OrdersController.php 1 location

@@ 44-57 (lines=14) @@
41
     * @Method("GET")
42
     * @Template()
43
     */
44
    public function indexAction(Request $request)
45
    {
46
        $em = $this->getDoctrine()->getManager();
47
        $item = $this->container->getParameter('knp_paginator.page_range');
48
        $qb = $em->getRepository('AppBundle:Orders')->createQueryBuilder('o');
49
        
50
        $createForm = $this->createCreateForm('orders_create');
51
52
        $paginator = $this->get('knp_paginator')->paginate($qb, $request->query->get('page', 1), $item);
53
        return array(
54
            'create_form' => $createForm->createView(),
55
            'paginator' => $paginator,
56
        );
57
    }
58
59
    /**
60
     * Finds and displays a Orders entity.