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

PartialResponse::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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