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::setAmount()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
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