PurchaseControllerTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 5
Bugs 0 Features 4
Metric Value
wmc 1
eloc 5
c 5
b 0
f 4
dl 0
loc 31
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getGatewaysManager() 0 3 1
1
<?php
2
3
namespace ByTIC\Payments\Controllers\Traits;
4
5
use ByTIC\Payments\Controllers\Traits\PurchaseController\PurchaseConfirmActionsTrait;
6
use ByTIC\Payments\Controllers\Traits\PurchaseController\PurchaseIpnActionsTrait;
7
use ByTIC\Payments\Controllers\Traits\PurchaseController\PurchaseRedirectActionsTrait;
8
use ByTIC\Payments\Gateways\Manager as GatewaysManager;
9
use ByTIC\Payments\Models\Purchase\Traits\IsPurchasableModelTrait;
10
use Nip\Records\AbstractModels\Record;
11
use Nip\Records\RecordManager;
12
use Symfony\Component\HttpFoundation\Request;
13
14
/**
15
 * Class PurchaseControllerTrait
16
 * @package ByTIC\Payments\Payments\Controllers\Traits
17
 *
18
 * @method IsPurchasableModelTrait checkItem
19
 */
20
trait PurchaseControllerTrait
21
{
22
    use PurchaseRedirectActionsTrait;
23
    use PurchaseConfirmActionsTrait;
24
    use PurchaseIpnActionsTrait;
25
26
    /**
27
     * @return GatewaysManager
28
     */
29
    protected function getGatewaysManager()
30
    {
31
        return GatewaysManager::instance();
32
    }
33
34
    /**
35
     * @param bool|array $key
36
     * @return Record|IsPurchasableModelTrait
37
     */
38
    abstract protected function getModelFromRequest($key = false);
39
40
    /**
41
     * @return RecordManager
42
     */
43
    abstract protected function getModelManager();
44
45
    /**
46
     * @return Request
47
     */
48
    abstract protected function getRequest();
49
50
    abstract protected function dispatchAccessDeniedResponse();
51
}
52