PaymentRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 54
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaymentRequestId() 0 4 1
A getUrl() 0 4 1
A getDynamicJavascriptUrl() 0 4 1
A init() 0 10 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