Completed
Push — master ( 3ee5ff...5084e8 )
by Joachim
12:38
created

PartialResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 51
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getOriginalResponse() 0 4 1
A getXmlDoc() 0 4 1
A init() 0 3 1
1
<?php
2
namespace Loevgaard\AltaPay\Response\Partial;
3
4
use Psr\Http\Message\ResponseInterface as PsrResponseInterface;
5
6
abstract class PartialResponse implements PartialResponseInterface
7
{
8
    /**
9
     * Holds the original response object
10
     *
11
     * @var PsrResponseInterface
12
     */
13
    protected $originalResponse;
14
15
    /**
16
     * Holds an XML object
17
     *
18
     * @var \SimpleXMLElement
19
     */
20
    protected $xmlDoc;
21
22
    /**
23
     * @param PsrResponseInterface $originalResponse
24
     * @param \SimpleXMLElement $xmlDoc
25
     */
26
    public function __construct(PsrResponseInterface $originalResponse, \SimpleXMLElement $xmlDoc)
27
    {
28
        $this->originalResponse = $originalResponse;
29
        $this->xmlDoc = $xmlDoc;
30
        $this->init();
31
    }
32
33
    /**
34
     * @return PsrResponseInterface
35
     */
36
    public function getOriginalResponse() : PsrResponseInterface
37
    {
38
        return $this->originalResponse;
39
    }
40
41
    /**
42
     * @return \SimpleXMLElement
43
     */
44
    public function getXmlDoc() : \SimpleXMLElement
45
    {
46
        return $this->xmlDoc;
47
    }
48
49
    /**
50
     * Is called after the contructor has initialized the properties
51
     * Use this to do any initialization you need
52
     */
53
    protected function init()
54
    {
55
    }
56
}
57