Passed
Push — master ( b2ca99...77b7f1 )
by Gabriel
05:51 queued 13s
created

PurchaseControllerTrait::redirectToPayment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 4
Bugs 0 Features 3
Metric Value
eloc 6
c 4
b 0
f 3
dl 0
loc 9
ccs 0
cts 7
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A PurchaseControllerTrait::getGatewaysManager() 0 3 1
1
<?php
2
3
namespace ByTIC\Payments\Controllers\Traits;
4
5
use ByTIC\Common\Records\Record;
6
use ByTIC\FacebookPixel\FacebookPixel;
7
use ByTIC\Omnipay\Common\Message\Traits\RedirectHtmlTrait;
8
use ByTIC\Payments\Controllers\Traits\PurchaseController\PurchaseConfirmActionsTrait;
9
use ByTIC\Payments\Controllers\Traits\PurchaseController\PurchaseIpnActionsTrait;
10
use ByTIC\Payments\Controllers\Traits\PurchaseController\PurchaseRedirectActionsTrait;
11
use ByTIC\Payments\Gateways\Manager as GatewaysManager;
12
use ByTIC\Payments\Models\Purchase\Traits\IsPurchasableModelTrait;
13
use Nip\Records\RecordManager;
14
use Nip\Request;
15
16
/**
17
 * Class PurchaseControllerTrait
18
 * @package ByTIC\Common\Payments\Controllers\Traits
19
 *
20
 * @method IsPurchasableModelTrait checkItem
21
 */
22
trait PurchaseControllerTrait
23
{
24
    use PurchaseRedirectActionsTrait;
25
    use PurchaseConfirmActionsTrait;
26
    use PurchaseIpnActionsTrait;
27
28
    /**
29
     * @return GatewaysManager
30
     */
31
    protected function getGatewaysManager()
32
    {
33
        return GatewaysManager::instance();
0 ignored issues
show
Bug introduced by
The method instance() does not exist on ByTIC\Payments\Gateways\Manager. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        return GatewaysManager::/** @scrutinizer ignore-call */ instance();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
    }
35
36
    /**
37
     * @param bool|array $key
38
     * @return Record|IsPurchasableModelTrait
39
     */
40
    abstract protected function getModelFromRequest($key = false);
41
42
    /**
43
     * @return RecordManager
44
     */
45
    abstract protected function getModelManager();
46
47
    /**
48
     * @return Request
49
     */
50
    abstract protected function getRequest();
51
52
    abstract protected function dispatchAccessDeniedResponse();
53
}
54