PaymentRequest::getDynamicJavascriptUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Loevgaard\AltaPay\Response;
3
4
use Loevgaard\AltaPay\Entity\ResultTrait;
5
6
class PaymentRequest extends Response
7
{
8
    use ResultTrait;
9
10
    /**
11
     * @var string
12
     */
13
    protected $paymentRequestId;
14
15
    /**
16
     * @var string
17
     */
18
    protected $url;
19
20
    /**
21
     * @var string
22
     */
23
    protected $dynamicJavascriptUrl;
24
25
    /**
26
     * @return string
27
     */
28 3
    public function getPaymentRequestId() : string
29
    {
30 3
        return $this->paymentRequestId;
31
    }
32
33
    /**
34
     * @return string
35
     */
36 3
    public function getUrl() : string
37
    {
38 3
        return $this->url;
39
    }
40
41
    /**
42
     * @return string
43
     */
44 3
    public function getDynamicJavascriptUrl() : string
45
    {
46 3
        return $this->dynamicJavascriptUrl;
47
    }
48
49 6
    protected function init()
50
    {
51
        /** @var \SimpleXMLElement $body */
52 6
        $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...
53
54 6
        $this->paymentRequestId     = (string)$body->PaymentRequestId;
55 6
        $this->url                  = (string)$body->Url;
56 6
        $this->dynamicJavascriptUrl = (string)$body->DynamicJavascriptUrl;
57 6
        $this->hydrateResult($body);
58 6
    }
59
}
60