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.
Completed
Push — master ( c3b60f...35c3e9 )
by Niels
04:43
created

CreateDirectOrderRequest   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 10
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 78
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getRecurringId() 0 4 1
A setRecurringId() 0 6 1
A getGatewayInfo() 0 4 1
A setGatewayInfo() 0 8 1
B validate() 0 12 5
1
<?php namespace Ntholenaar\MultiSafepayClient\Request;
2
3
class CreateDirectOrderRequest extends CreateOrderRequest implements RequestInterface
4
{
5
    /**
6
     * @param $environment
7
     * @param array $parameters
8
     * @param \Http\Message\MessageFactory|null $messageFactory
9
     */
10
    public function __construct($environment, array $parameters, $messageFactory)
11
    {
12
        parent::__construct($environment, $parameters, $messageFactory);
13
14
        $this->setType('direct');
15
    }
16
17
    /**
18
     * Get the recurring identifier.
19
     *
20
     * @return string|null
21
     */
22
    public function getRecurringId()
23
    {
24
        return $this->getRequestBodyParameter('recurring_id');
25
    }
26
27
    /**
28
     * Set the recurring identifier.
29
     *
30
     * @param $recurringId
31
     * @return $this
32
     */
33
    public function setRecurringId($recurringId)
34
    {
35
        $this->setRequestBodyParameter('recurring_id', $recurringId);
36
37
        return $this;
38
    }
39
40
    /**
41
     * Get the gateway info.
42
     *
43
     * @return array|null
44
     */
45
    public function getGatewayInfo()
46
    {
47
        return $this->getRequestBodyParameter('gateway_info');
48
    }
49
50
    /**
51
     * Set the gateway info.
52
     *
53
     * @param array $gatewayInfo
54
     * @return $this
55
     */
56
    public function setGatewayInfo(array $gatewayInfo)
57
    {
58
        // @todo validate, and filter invalid array keys.
59
60
        $this->setRequestBodyParameter('gateway_info', $gatewayInfo);
61
62
        return $this;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function validate()
69
    {
70
        if (parent::validate() === false ||
71
            is_null($this->getGatewayId()) ||
72
            is_null($this->getGatewayInfo()) ||
73
            is_null($this->getRecurringId())
74
        ) {
75
            return false;
76
        }
77
78
        return true;
79
    }
80
}
81