Passed
Pull Request — 1.x (#36)
by Darío
03:55 queued 01:55
created

ShippingAddress::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace PaymentGateway\PayPalSdk\Subscriptions;
4
5
class ShippingAddress
6
{
7
    private ?ShippingDetailName $name = null;
8
    private ?ShippingDetailAddressPortable $address = null;
9
10
    public function getName(): ?ShippingDetailName
11
    {
12
        return $this->name;
13
    }
14
15
    public function setName(?ShippingDetailName $name): self
16
    {
17
        $this->name = $name;
18
19
        return $this;
20
    }
21
22
    public function getAddress(): ?ShippingDetailAddressPortable
23
    {
24
        return $this->address;
25
    }
26
27
    public function setAddress(?ShippingDetailAddressPortable $address): self
28
    {
29
        $this->address = $address;
30
31
        return $this;
32
    }
33
34
    public function toArray(): array
35
    {
36
        $data = [];
37
38
        if ($this->name) {
39
            $data['name'] = $this->name->toArray();
40
        }
41
42
        if ($this->address) {
43
            $data['address'] = $this->address->toArray();
44
        }
45
46
        return $data;
47
    }
48
}
49