Code Duplication    Length = 6-7 lines in 2 locations

Controller/SubscriptionController.php 2 locations

@@ 21-27 (lines=7) @@
18
        $form = $this->createForm(new SubscriptionType(), new \Recurly_BillingInfo());
19
        $form->handleRequest($request);
20
21
        if ($form->isValid()) {
22
            $this->get('tahoe.multi_tenancy.gateway.recurly')->createSubscription($tenant, $form->getData());
23
24
            $this->get('session')->getFlashBag()->add('success', 'The subscription has been created successfully');
25
26
            return $this->redirect($this->generateUrl('tahoe_multitenancy_subscription'));
27
        }
28
29
        return $this->render('TahoeMultiTenancyBundle:Subscription:index.html.twig', array(
30
            'form' => $form->createView()
@@ 47-52 (lines=6) @@
44
        $form = $this->createForm(new SubscriptionType(), $billingInfo);
45
        $form->handleRequest($request);
46
47
        if ($form->isValid()) {
48
            $this->get('tahoe.multi_tenancy.gateway.recurly')->updateBillingInfo($tenant, $form->getData());
49
            $this->get('session')->getFlashBag()->add('success', 'Your billing information has been updated successfully');
50
51
            return $this->redirect($this->generateUrl('tahoe_multitenancy_subscription'));
52
        }
53
54
        return $this->render('TahoeMultiTenancyBundle:Subscription:index.html.twig', array(
55
            'form' => $form->createView(),