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.

DirectLinkMaintenanceRequest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 41
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRequiredFields() 0 9 1
A getValidOgoneUris() 0 4 1
A setAmount() 0 8 2
A setOperation() 0 4 1
1
<?php
2
/*
3
 * @author Nicolas Clavaud <[email protected]>
4
 */
5
6
namespace Ogone\DirectLink;
7
8
use Ogone\AbstractDirectLinkRequest;
9
use Ogone\ShaComposer\ShaComposer;
10
use InvalidArgumentException;
11
12
class DirectLinkMaintenanceRequest extends AbstractDirectLinkRequest
13
{
14
15
    const TEST = "https://secure.ogone.com/ncol/test/maintenancedirect.asp";
16
    const PRODUCTION = "https://secure.ogone.com/ncol/prod/maintenancedirect.asp";
17
18 9
    public function __construct(ShaComposer $shaComposer)
19
    {
20 9
        $this->shaComposer = $shaComposer;
21 9
        $this->ogoneUri = self::TEST;
22 9
    }
23
24 4
    public function getRequiredFields()
25
    {
26
        return array(
27 4
            'pspid',
28
            'userid',
29
            'pswd',
30
            'operation',
31
        );
32
    }
33
34 2
    public function getValidOgoneUris()
35
    {
36 2
        return array(self::TEST, self::PRODUCTION);
37
    }
38
39 3
    public function setAmount($amount)
40
    {
41 3
        if (!is_int($amount)) {
42 2
            throw new InvalidArgumentException("Amount should be an integer");
43
        }
44
45 1
        $this->parameters['amount'] = $amount;
46 1
    }
47
48 4
    public function setOperation(MaintenanceOperation $operation)
49
    {
50 4
        $this->parameters['operation'] = (string) $operation;
51 4
    }
52
}
53