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.

RawSoapContext::setWSDL()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 14
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
1
<?php
2
/**
3
 * @author Alexei Gorobet, <[email protected]>
4
 */
5
namespace Behat\SoapExtension\Context;
6
7
use Behat\SoapExtension\Utils\SoapManager;
8
9
/**
10
 * Class RawSoapContext.
11
 *
12
 * @package Behat\SoapExtension\Context
13
 */
14
class RawSoapContext implements SoapContextInterface
15
{
16
    use SoapManager {
17
        setWSDL as soapWSDL;
18
    }
19
20
    /**
21
     * Parameters of SoapExtension.
22
     *
23
     * @var array
24
     */
25
    private $parameters = [];
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function setSoapParameters(array $parameters)
31
    {
32
        if (empty($this->parameters)) {
33
            $this->parameters = $parameters;
34
        }
35
    }
36
37
    /**
38
     * @param string $name
39
     *   The name of parameter from behat.yml.
40
     *
41
     * @return mixed
42
     */
43
    protected function getSoapParameter($name)
44
    {
45
        return isset($this->parameters[$name]) ? $this->parameters[$name] : false;
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     *
51
     * @see SoapManager::setOptions()
52
     * @see SoapManager::setNamespaces()
53
     */
54
    protected function setWSDL($wsdl)
55
    {
56
        // Initialize SOAP manager with predefined values from configuration.
57
        foreach (['options', 'namespaces'] as $param) {
58
            $method = 'set' . ucfirst($param);
59
60
            // Unset all options and namespaces and initialize them from config.
61
            foreach ([null, $this->getSoapParameter($param)] as $value) {
62
                call_user_func([$this, $method], $value);
63
            }
64
        }
65
66
        $this->soapWSDL($wsdl);
67
    }
68
}
69