ApiController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A webhookAction() 0 9 1
A getPartFireMangoPayService() 0 4 1
1
<?php
2
/**
3
 * Created by Graham Owens ([email protected])
4
 * Company: PartFire Ltd (www.partfire.co.uk)
5
 * Console: Discovery
6
 *
7
 * User:    gra
8
 * Date:    20/01/17
9
 * Time:    09:12
10
 * Project: PartFire MangoPay Bundle
11
 * File:    ApiController.php
12
 *
13
 **/
14
15
namespace PartFire\MangoPayBundle\Controller;
16
17
use PartFire\CommonBundle\Controller\ApiBaseController;
18
use PartFire\MangoPayBundle\Services\HookHandleService;
19
use Symfony\Component\HttpFoundation\Request;
20
use Symfony\Component\HttpFoundation\Response;
21
22
class ApiController extends ApiBaseController
23
{
24
    public function webhookAction(Request $request)
25
    {
26
        $allVars = $request->query->all();
27
28
        $onfidoWebHookService = $this->getPartFireMangoPayService();
29
        $onfidoWebHookService->processRequest($allVars);
30
31
        return new Response('', 201);
32
    }
33
34
    private function getPartFireMangoPayService() : HookHandleService
35
    {
36
        return $this->container->get('part_fire_mango_pay.services.webhook');
37
    }
38
}