Gateway   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 91
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 90.48%

Importance

Changes 0
Metric Value
wmc 9
lcom 0
cbo 1
dl 0
loc 91
ccs 19
cts 21
cp 0.9048
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getAssetDir() 0 4 1
A getPurse() 0 4 1
A setPurse() 0 4 1
A getSecret() 0 4 1
A setSecret() 0 4 1
A purchase() 0 4 1
A completePurchase() 0 4 1
A getDefaultParameters() 0 8 1
1
<?php
2
/**
3
 * ePayService driver for the Omnipay PHP payment processing library.
4
 *
5
 * @link      https://github.com/hiqdev/omnipay-epayservice
6
 * @package   omnipay-epayservice
7
 * @license   MIT
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace Omnipay\ePayService;
12
13
use Omnipay\Common\AbstractGateway;
14
15
/**
16
 * Gateway for ePayService.
17
 */
18
class Gateway extends AbstractGateway
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23 1
    public function getName()
24
    {
25 1
        return 'ePayService';
26
    }
27
28
    public function getAssetDir()
29
    {
30
        return dirname(__DIR__) . '/assets';
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 29
    public function getDefaultParameters()
37
    {
38
        return [
39 29
            'purse'         => '',
40 29
            'secret'        => '',
41 29
            'testMode'      => false,
42 29
        ];
43
    }
44
45
    /**
46
     * Get the unified purse.
47
     *
48
     * @return string merchant purse
49
     */
50 2
    public function getPurse()
51
    {
52 2
        return $this->getParameter('purse');
53
    }
54
55
    /**
56
     * Set the unified purse.
57
     *
58
     * @param string $purse merchant purse
0 ignored issues
show
Bug introduced by
There is no parameter named $purse. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
59
     *
60
     * @return self
61
     */
62 29
    public function setPurse($value)
63
    {
64 29
        return $this->setParameter('purse', $value);
65
    }
66
67
    /**
68
     * Get the unified secret key.
69
     *
70
     * @return string secret key
71
     */
72 2
    public function getSecret()
73
    {
74 2
        return $this->getParameter('secret');
75
    }
76
77
    /**
78
     * Set the unified secret key.
79
     *
80
     * @param string $value secret key
81
     *
82
     * @return self
83
     */
84 29
    public function setSecret($value)
85
    {
86 29
        return $this->setParameter('secret', $value);
87
    }
88
89
    /**
90
     * @param array $parameters
91
     *
92
     * @return \Omnipay\ePayService\Message\PurchaseRequest
93
     */
94 3
    public function purchase(array $parameters = [])
95
    {
96 3
        return $this->createRequest('\Omnipay\ePayService\Message\PurchaseRequest', $parameters);
97
    }
98
99
    /**
100
     * @param array $parameters
101
     *
102
     * @return \Omnipay\ePayService\Message\CompletePurchaseRequest
103
     */
104 3
    public function completePurchase(array $parameters = [])
105
    {
106 3
        return $this->createRequest('\Omnipay\ePayService\Message\CompletePurchaseRequest', $parameters);
107
    }
108
}
109