Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
40 | 6 | public function __construct(string $code, string $reason, string $node = null, array $detail = null) |
|
41 | { |
||
42 | 6 | $this->code = is_array($code) ? implode('.', $code) : $code; |
|
|
|||
43 | 6 | $this->reason = $reason; |
|
44 | 6 | $this->node = $node; |
|
45 | 6 | $this->detail = $detail; |
|
46 | |||
47 | 6 | if (class_exists(\SoapFault::class)) { |
|
48 | 6 | $code = preg_replace( |
|
49 | 6 | ['~^Receiver~', '~^Sender~', '~^DataEncodingUnknown~'], |
|
50 | 6 | ['Server', 'Client', 'Client'], |
|
51 | 6 | $this->code |
|
52 | ); |
||
53 | 6 | $previous = new \SoapFault($code, $reason, $node, $detail); |
|
54 | } |
||
55 | |||
56 | 6 | parent::__construct($reason, 0, $previous ?? null); |
|
57 | 6 | } |
|
64 |