Completed
Push — master ( 4e4f46...7bbaf3 )
by Rafał
04:03
created

DefaultController::thankYouAction()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PH\Bundle\CoreBundle\Controller;
6
7
use PH\Bundle\SubscriptionBundle\Form\Type\SubscriptionType;
8
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
9
use Symfony\Component\HttpFoundation\Request;
10
11
class DefaultController extends Controller
12
{
13
    public function indexAction(Request $request)
14
    {
15
        $subscriptionFactory = $this->get('ph.factory.subscription');
16
17
        $form = $this->createForm(SubscriptionType::class, $subscriptionFactory->createNew());
18
        $form->handleRequest($request);
19
20
        return $this->render('@PHCore/index.html.twig', [
21
            'form' => $form->createView(),
22
        ]);
23
    }
24
25
    public function thankYouAction(Request $request)
26
    {
27
        return $this->render('@PHCore/thankYou.html.twig', [
28
            'token' => $request->query->has('token') ? $request->query->has('token') : '',
29
        ]);
30
    }
31
32
    public function cancelAction(Request $request)
33
    {
34
        return $this->render('@PHCore/cancel.html.twig', [
35
            'token' => $request->query->has('token') ? $request->query->has('token') : '',
36
        ]);
37
    }
38
}
39