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

SoapConfig::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
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 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace WebservicesNl\Protocol\Soap\Client;
4
5
use WebservicesNl\Common\Config\ConfigInterface;
6
use WebservicesNl\Platform\PlatformConfigInterface;
7
use WebservicesNl\Protocol\Soap\Exception\ConverterInterface;
8
9
/**
10
 * Class SoapConfig
11
 *
12
 * Soap config object that holds all data for a specific SOAP connection
13
 */
14
class SoapConfig implements ConfigInterface
15
{
16
    const DEFAULT_RESPONSE_TIMEOUT = 20;
17
    const RETRY_MINUTES = 60;
18
19
    /**
20
     * @var ConverterInterface
21
     */
22
    protected $converter;
23
24
    /**
25
     * List with Soap Server endpoints for platform.
26
     *
27
     * @var array
28
     */
29
    protected static $endPoints = [];
30
31
    /**
32
     * @var PlatformConfigInterface
33
     */
34
    protected $platformConfig;
35
36
    /**
37
     * @var array
38
     */
39
    protected $soapHeaders = [];
40
41
    /**
42
     * SoapConfig constructor.
43
     *
44
     * @param PlatformConfigInterface $config
45
     */
46
    public function __construct(PlatformConfigInterface $config)
47
    {
48
        $this->platformConfig = $config;
49
    }
50
51
    /**
52
     * Returns configured instance.
53
     *
54
     * @param PlatformConfigInterface $config
55
     *
56
     * @return ConfigInterface
57
     */
58
    public static function configure($config)
59
    {
60
        return new static($config);
61
    }
62
63
    /**
64
     * @return ConverterInterface
65
     */
66
    public function getConverter()
67
    {
68
        return $this->converter;
69
    }
70
71
    /**
72
     * Return array with Endpoints
73
     *
74
     * @return array
75
     */
76
    public static function getEndPoints()
77
    {
78
        return static::$endPoints;
79
    }
80
81
    /**
82
     * @return PlatformConfigInterface
83
     */
84
    public function getPlatformConfig()
85
    {
86
        return $this->platformConfig;
87
    }
88
89
    /**
90
     * @return array
91
     */
92
    public function getSoapHeaders()
93
    {
94
        return $this->soapHeaders;
95
    }
96
97
    /**
98
     * @return bool
99
     */
100
    public function hasConverter()
101
    {
102
        return $this->converter instanceof ConverterInterface;
103
    }
104
105
    /**
106
     * Return config as an array
107
     *
108
     * @return array
109
     */
110
    public function toArray()
111
    {
112
        return [
113
            'converter' => $this->getConverter(),
114
            'endpoints'      => static::$endPoints,
115
            'platformConfig' => $this->platformConfig->toArray(),
116
            'retry_minutes'  => static::DEFAULT_RESPONSE_TIMEOUT,
117
            'soap_headers'   => (array)$this->getSoapHeaders(),
118
        ];
119
    }
120
}
121