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.
Test Setup Failed
Push — master ( fe4962...3aa77f )
by Thijs
04:04
created

Config::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace WebservicesNl\Protocol\Soap\Config\Platform\Webservices;
4
5
use WebservicesNl\Platform\Webservices\PlatformConfig;
6
use WebservicesNl\Protocol\Soap\Client\SoapConfig;
7
8
/**
9
 * Class WebservicesConfig.
10
 *
11
 * Container for all settings to connect to Webservices platform. User credentials and time out settings. etc
12
 */
13
class Config extends SoapConfig
14
{
15
    const DEFAULT_RESPONSE_TIMEOUT = 20;
16
    const RETRY_MINUTES = 60;
17
    const SOAPHEADER_URL = 'http://www.webservices.nl/soap/';
18
19
    /**
20
     * List with Soap Server endpoints.
21
     *
22
     * @var array
23
     */
24
    protected static $endPoints = [
25
        'https://ws1.webservices.nl/soap',
26
        'https://ws2.webservices.nl/soap',
27
    ];
28
29
    /**
30
     * Config constructor.
31
     *
32
     * @param PlatformConfig $config
33
     */
34
    public function __construct(PlatformConfig $config)
35
    {
36
        $this->converter = Converter::build();
37
        $this->soapHeaders[] = new \SoapHeader(
38
            self::SOAPHEADER_URL,
39
            'HeaderLogin',
40
            [
41
                'username' => $config->getUserName(),
42
                'password' => $config->getPassword(),
43
            ],
44
            true
45
        );
46
47
        parent::__construct($config);
48
    }
49
50
    /**
51
     * @return Converter
52
     */
53
    public function getConverter()
54
    {
55
        return $this->converter;
56
    }
57
58
59
    /**
60
     * @return int
61
     */
62
    public function getConnectionTimeout()
63
    {
64
        return $this->getPlatformConfig()->getConnectionTimeout();
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function getPassword()
71
    {
72
        return $this->getPlatformConfig()->getPassword();
73
    }
74
75
    /**
76
     * @return int
77
     */
78
    public function getRetryMinutes()
79
    {
80
        return $this->getPlatformConfig()->getRetryMinutes();
81
    }
82
83
    /**
84
     * @return int
85
     */
86
    public function getResponseTimeout()
87
    {
88
        return $this->getPlatformConfig()->getResponseTimeout();
89
    }
90
91
    /**
92
     * @return array
93
     */
94
    public function getSoapHeaders()
95
    {
96
        return $this->soapHeaders;
97
    }
98
99
    /**
100
     * @return string
101
     */
102
    public function getUserName()
103
    {
104
        return $this->getPlatformConfig()->getUserName();
105
    }
106
107
    /**
108
     * @return array
109
     */
110
    public function toArray()
111
    {
112
        return array_filter([
113
            'converter'          => $this->getConverter(),
114
            'connection_timeout' => $this->getPlatformConfig()->getConnectionTimeout(),
115
            'endpoints'          => self::$endPoints,
116
            'password'           => $this->getPlatformConfig()->getPassword(),
117
            'retry_minutes'      => $this->getPlatformConfig()->getRetryMinutes(),
118
            'soap_headers'       => (array)$this->getSoapHeaders(),
119
            'timeout'            => $this->getPlatformConfig()->getResponseTimeout(),
120
            'username'           => $this->getPlatformConfig()->getUserName(),
121
        ]);
122
    }
123
124
    /**
125
     * @return PlatformConfig
126
     */
127
    public function getPlatformConfig()
128
    {
129
        return $this->platformConfig;
130
    }
131
}
132