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::validate()   B

Complexity

Conditions 5
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 8.8571
cc 5
eloc 7
nc 2
nop 0
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