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

SoapFault::getDetail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace WebservicesNl\Protocol\Soap\Exception;
4
5
/**
6
 * Abstract Class SoapFault.
7
 *
8
 * Extends SoapFault into a Webservices SoapFault (just for getters and setters)
9
 *
10
 * @link http://php.net/manual/en/soapfault.soapfault.php
11
 */
12
class SoapFault extends \SoapFault
13
{
14
    protected $faultCodes = [
15
        SOAP_1_1 => ['Server', 'Client', 'VersionMismatch', 'MustUnderstand'],
16
        SOAP_1_2 => ['Sender', 'Receiver', 'VersionMismatch', 'MustUnderstand', 'DataEncodingUnknown'],
17
    ];
18
19
    /**
20
     * More details about the cause of the error.
21
     *
22
     * Required if the fault is an error related to the SOAPBody object. If, for example, the fault code is Client,
23
     * indicating that the message could not be processed because of a problem in the SOAPBody object,
24
     * the SOAPFault object must contain a Detail object that gives details about the problem.
25
     * If a SOAPFault object does not contain a Detail object, it can be assumed that the SOAPBody object was processed
26
     * successfully.
27
     *
28
     * @var string
29
     */
30
    public $detail;
31
32
    /**
33
     * A string identifying the actor that caused the error.
34
     *
35
     * Required if the SOAPHeader object contains one or more actor attributes; optional if no actors are specified.
36
     * Meaning that the only actor is the ultimate destination. The fault actor, which is specified as a URI, identifies
37
     * who caused the fault.
38
     *
39
     * @var string
40
     */
41
    public $faultActor;
42
43
    /**
44
     * The Soap Fault code (either Sender or Receiver).
45
     *
46
     * @link https://www.w3.org/TR/soap12-part1/#faultcodes
47
     *
48
     * @var string
49
     */
50
    public $faultCode;
51
52
    /**
53
     * Can be used to select the proper fault encoding from WSDL.
54
     *
55
     * @var string
56
     */
57
    public $faultName;
58
59
    /**
60
     * The error message of the SoapFault.
61
     * Always required. A human-readable explanation of the fault.
62
     *
63
     * @var string
64
     */
65
    public $faultString = 'Something went wrong';
66
67
    /**
68
     * Can be used during SOAP header handling to report an error in the response header.
69
     *
70
     * @var string
71
     */
72
    public $headerFault;
73
74
    /**
75
     * SoapFault constructor.
76
     *
77
     * @param string $message
78
     * @param int    $detail
79
     */
80
    public function __construct($message, $detail)
81
    {
82
        $this->message = $message;
83
        $this->detail = $detail;
0 ignored issues
show
Documentation Bug introduced by
The property $detail was declared of type string, but $detail is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
84
85
        parent::SoapFault(
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (SoapFault() instead of __construct()). Are you sure this is correct? If so, you might want to change this to $this->SoapFault().

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...
86
            $this->getFaultCode(),
87
            $this->getFaultString(),
88
            $this->getFaultActor(),
89
            $this->getDetail(),
90
            $this->getFaultName(),
91
            $this->getHeaderFault()
92
        );
93
    }
94
95
    /**
96
     * @return string
97
     */
98
    public function getFaultCode()
99
    {
100
        return $this->faultCode;
101
    }
102
103
    /**
104
     * @return string
105
     */
106
    public function getFaultActor()
107
    {
108
        return $this->faultActor;
109
    }
110
111
    /**
112
     * @return string
113
     */
114
    public function getDetail()
115
    {
116
        return $this->detail;
117
    }
118
119
    /**
120
     * @return string
121
     */
122
    public function getFaultName()
123
    {
124
        return $this->faultName;
125
    }
126
127
    /**
128
     * @return string
129
     */
130
    public function getHeaderFault()
131
    {
132
        return $this->headerFault;
133
    }
134
135
    /**
136
     * @return string
137
     */
138
    public function getFaultString()
139
    {
140
        return $this->faultString;
141
    }
142
}
143