Completed
Push — master ( ad55a4...c98fe8 )
by Joachim
01:57
created

RefundCapturedReservation::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
crap 1
1
<?php
2
namespace Loevgaard\AltaPay\Response;
3
4
use Loevgaard\AltaPay\Entity\ResultTrait;
5
use Loevgaard\AltaPay\Entity\TransactionsTrait;
6
7
class RefundCapturedReservation extends Response
8
{
9
    use ResultTrait;
10
    use TransactionsTrait;
11
12
    /**
13
     * @var float
14
     */
15
    protected $refundAmount;
16
17
    /**
18
     * @var int
19
     */
20
    protected $refundCurrency;
21
22
    /**
23
     * @deprecated
24
     * @var string
25
     */
26
    protected $refundResult;
27
28
    /**
29
     * @return float
30
     */
31
    public function getRefundAmount(): float
32
    {
33
        return $this->refundAmount;
34
    }
35
36
    /**
37
     * @return int
38
     */
39
    public function getRefundCurrency(): int
40
    {
41
        return $this->refundCurrency;
42
    }
43
44
    /**
45
     * @deprecated
46
     * @return string
47
     */
48
    public function getRefundResult(): string
49
    {
50
        return $this->refundResult;
0 ignored issues
show
Deprecated Code introduced by
The property Loevgaard\AltaPay\Respon...ervation::$refundResult has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
51
    }
52
53 3
    protected function init()
54
    {
55
        /** @var \SimpleXMLElement $body */
56 3
        $body = $this->xmlDoc->Body;
0 ignored issues
show
Bug introduced by
The property Body does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
57
58 3
        $this->refundAmount = (float)$body->RefundAmount;
59 3
        $this->refundCurrency = (int)$body->RefundCurrency;
60 3
        $this->refundResult = (string)$body->RefundResult;
0 ignored issues
show
Deprecated Code introduced by
The property Loevgaard\AltaPay\Respon...ervation::$refundResult has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
61 3
        $this->hydrateTransactions($body);
62 3
    }
63
}
64