Code Duplication    Length = 45-47 lines in 2 locations

src/Envelope/SoapEnvelope12/Messages/Fault.php 1 location

@@ 14-58 (lines=45) @@
11
/**
12
 * Class representing Body
13
 */
14
class Fault implements FaultMessageInterface
15
{
16
17
    /**
18
     * @property \GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope12\Messages\FaultBody $body
19
     */
20
    private $body = null;
21
22
    /**
23
     * Gets as body
24
     *
25
     * @return \GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope12\Messages\FaultBody
26
     */
27
    public function getBody()
28
    {
29
        return $this->body;
30
    }
31
32
    /**
33
     * Sets a new body
34
     *
35
     * @param \GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope12\Messages\FaultBody $body
36
     * @return self
37
     */
38
    public function setBody(\GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope12\Messages\FaultBody $body)
39
    {
40
        $this->body = $body;
41
        return $this;
42
    }
43
44
    /**
45
     * @param ResponseInterface $response
46
     * @param RequestInterface $request
47
     * @param \Exception $e
48
     * @return FaultException
49
     */
50
    public function createException(ResponseInterface $response, RequestInterface $request, \Exception $e = null)
51
    {
52
        if (!$this->getBody() || !$this->getBody()->getFault()) {
53
            throw new FaultException($response, $request, $e);
54
        }
55
        return new Fault12Exception($this->getBody()->getFault(), $response, $request, $e);
56
    }
57
58
}
59
60

src/Envelope/SoapEnvelope/Messages/Fault.php 1 location

@@ 14-60 (lines=47) @@
11
/**
12
 * Class representing Body
13
 */
14
class Fault implements FaultMessageInterface
15
{
16
17
    /**
18
     * @property \GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope\Messages\FaultBody $body
19
     */
20
    private $body = null;
21
22
    /**
23
     * Gets as body
24
     *
25
     * @return \GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope\Messages\FaultBody
26
     */
27
    public function getBody()
28
    {
29
        return $this->body;
30
    }
31
32
    /**
33
     * Sets a new body
34
     *
35
     * @param \GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope\Messages\FaultBody $body
36
     * @return self
37
     */
38
    public function setBody(\GoetasWebservices\SoapServices\SoapClient\Envelope\SoapEnvelope\Messages\FaultBody $body)
39
    {
40
        $this->body = $body;
41
        return $this;
42
    }
43
44
    /**
45
     * @param ResponseInterface $response
46
     * @param RequestInterface $request
47
     * @param \Exception $e
48
     * @return FaultException
49
     */
50
    public function createException(ResponseInterface $response, RequestInterface $request, \Exception $e = null)
51
    {
52
        if (!$this->getBody() || !$this->getBody()->getFault()) {
53
            throw new FaultException($response, $request, $e);
54
        }
55
56
        return new Fault11Exception($this->getBody()->getFault(), $response, $request, $e);
57
    }
58
59
60
}
61
62