Code Duplication    Length = 45-47 lines in 2 locations

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

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

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