Completed
Push — soap-12 ( c22311...ee369f )
by Asmir
26:29
created

Fault::getCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace GoetasWebservices\SoapServices\SoapClient\SoapEnvelope\Parts;
4
5
/**
6
 * Class representing DoSomethingInput
7
 */
8
class Fault
9
{
10
    /**
11
     * @var string
12
     */
13
    private $actor;
14
    /**
15
     * @var \Exception
16
     */
17
    private $exception;
18
19
    public function setException(\Exception $exception)
20
    {
21
        $this->exception = $exception;
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function getActor()
28
    {
29
        return $this->actor;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getCode()
36
    {
37
        $ref = new \ReflectionObject($this->exception);
38
        return 'SOAP-ENV:' . str_replace('Exception', '', $ref->getShortName()); //$this->exception->getCode();
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getDescription()
45
    {
46
        return $this->exception->getMessage();
47
    }
48
49
    /**
50
     * @param string $actor
51
     * @return Fault
52
     */
53
    public function setActor($actor)
54
    {
55
        $this->actor = $actor;
56
    }
57
58
}
59
60