GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SampleController::indexAction()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 26
rs 8.8571
cc 1
eloc 20
nc 1
nop 0
1
<?php
2
3
namespace Lexik\Bundle\PayboxBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Symfony\Component\HttpFoundation\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
use Symfony\Component\Routing\Generator\UrlGenerator;
9
10
/**
11
 * Class SampleController
12
 *
13
 * @package Lexik\Bundle\PayboxBundle\Controller
14
 *
15
 * @author Lexik <[email protected]>
16
 * @author Olivier Maisonneuve <[email protected]>
17
 */
18
class SampleController extends Controller
19
{
20
    /**
21
     * Index action creates the form for a payment call.
22
     *
23
     * @return Response
24
     */
25
    public function indexAction()
26
    {
27
        $paybox = $this->get('lexik_paybox.request_handler');
28
        $paybox->setParameters(array(
29
            'PBX_CMD'          => 'CMD'.time(),
30
            'PBX_DEVISE'       => '978',
31
            'PBX_PORTEUR'      => '[email protected]',
32
            'PBX_RETOUR'       => 'Mt:M;Ref:R;Auto:A;Erreur:E',
33
            'PBX_TOTAL'        => '1000',
34
            'PBX_TYPEPAIEMENT' => 'CARTE',
35
            'PBX_TYPECARTE'    => 'CB',
36
            'PBX_EFFECTUE'     => $this->generateUrl('lexik_paybox_sample_return', array('status' => 'success'), UrlGenerator::ABSOLUTE_URL),
37
            'PBX_REFUSE'       => $this->generateUrl('lexik_paybox_sample_return', array('status' => 'denied'), UrlGenerator::ABSOLUTE_URL),
38
            'PBX_ANNULE'       => $this->generateUrl('lexik_paybox_sample_return', array('status' => 'canceled'), UrlGenerator::ABSOLUTE_URL),
39
            'PBX_RUF1'         => 'POST',
40
            'PBX_REPONDRE_A'   => $this->generateUrl('lexik_paybox_ipn', array('time' => time()), UrlGenerator::ABSOLUTE_URL),
41
        ));
42
43
        return $this->render(
44
            'LexikPayboxBundle:Sample:index.html.twig',
45
            array(
46
                'url'  => $paybox->getUrl(),
47
                'form' => $paybox->getForm()->createView(),
48
            )
49
        );
50
    }
51
52
    /**
53
     * Return action for a confirmation payment page on which the user is sent
54
     * after he seizes his payment informations on the Paybox's platform.
55
     * This action might only containts presentation logic.
56
     *
57
     * @param Request $request
58
     * @param string  $status
59
     *
60
     * @return Response
61
     */
62
    public function returnAction(Request $request, $status)
63
    {
64
        return $this->render('LexikPayboxBundle:Sample:return.html.twig', array(
65
            'status'     => $status,
66
            'parameters' => $request->query,
67
        ));
68
    }
69
}
70