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.

SoapClient   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 92
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 63.64%

Importance

Changes 0
Metric Value
dl 0
loc 92
ccs 14
cts 22
cp 0.6364
rs 10
c 0
b 0
f 0
wmc 8
lcom 1
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __soapCall() 0 11 2
A soapCall() 0 11 3
A setTestingClient() 0 5 1
A getTestingClient() 0 4 1
A turnOffTestingClient() 0 5 1
1
<?php
2
3
namespace SmsaSDK;
4
5
/**
6
 * SoapClient
7
 * Insert description here.
8
 */
9
class SoapClient extends \SoapClient
10
{
11
    public static $testing = false;
12
    public static $lastException = null;
13
    public static $client = null;
14
    public static $lastCall = null;
15
16
    /**
17
     * __soapCall
18
     * Insert description here.
19
     *
20
     * @param $function_name
21
     * @param $arguments
22
     * @param $options
23
     * @param $input_headers
24
     * @param $output_headers
25
     *
26
     * @return
27
     */
28 3
    public function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
29
    {
30 3
        static::$lastCall = compact('function_name', 'arguments', 'options', 'input_headers', 'output_headers');
31
32
        // if the alternative client was set, for testing or customization for example
33 3
        if (static::$client) {
34 3
            return static::$client->$function_name($arguments);
35
        }
36
37
        return $this->soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
38
    }
39
40
    /**
41
     * soapCall
42
     * Insert description here.
43
     *
44
     * @param $function_name
45
     * @param $arguments
46
     * @param $options
47
     * @param $input_headers
48
     * @param $output_headers
49
     *
50
     * @return
51
     */
52
    private function soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
53
    {
54
        try {
55
            return parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (__soapCall() instead of soapCall()). Are you sure this is correct? If so, you might want to change this to $this->__soapCall().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
56
        } catch (\Exception $e) {
57
            static::$lastException = $e;
58
            if (!static::$testing) {
59
                throw $e;
60
            }
61
        }
62
    }
63
64
    /**
65
     * setTestingClient
66
     * Insert description here.
67
     *
68
     * @param $client
69
     *
70
     * @return
71
     */
72 4
    public static function setTestingClient($client = null)
73
    {
74 4
        static::$testing = true;
75 4
        static::$client = $client;
76 4
    }
77
78
    /**
79
     * getTestingClient
80
     * Insert description here.
81
     *
82
     * @return
83
     */
84 3
    public static function getTestingClient()
85
    {
86 3
        return static::$client;
87
    }
88
89
    /**
90
     * turnOffTestingClient
91
     * Insert description here.
92
     *
93
     * @return
94
     */
95 1
    public static function turnOffTestingClient()
96
    {
97 1
        static::$testing = false;
98 1
        static::$client = null;
99 1
    }
100
}
101