Passed
Push — feature/refactor-subscription-... ( 326c18 )
by Darío
03:04
created

PaymentMethod   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 10
eloc 21
c 1
b 0
f 0
dl 0
loc 59
ccs 24
cts 24
cp 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getPayeePreferred() 0 3 1
A setPayeePreferred() 0 5 1
A getPayerSelected() 0 3 1
A getStandardEntryClassCode() 0 3 1
A setPayerSelected() 0 5 1
A toArray() 0 17 4
A setStandardEntryClassCode() 0 5 1
1
<?php
2
3
namespace PaymentGateway\PayPalSdk\Subscriptions;
4
5
class PaymentMethod
6
{
7
    private ?string $payerSelected = null;
8
    private ?string $payeePreferred = null;
9
    private ?string $standardEntryClassCode = null;
10
11 1
    public function getPayerSelected(): ?string
12
    {
13 1
        return $this->payerSelected;
14
    }
15
16 4
    public function setPayerSelected(?string $payerSelected): self
17
    {
18 4
        $this->payerSelected = $payerSelected;
19
20 4
        return $this;
21
    }
22
23 1
    public function getPayeePreferred(): ?string
24
    {
25 1
        return $this->payeePreferred;
26
    }
27
28 3
    public function setPayeePreferred(?string $payeePreferred): self
29
    {
30 3
        $this->payeePreferred = $payeePreferred;
31
32 3
        return $this;
33
    }
34
35 1
    public function getStandardEntryClassCode(): ?string
36
    {
37 1
        return $this->standardEntryClassCode;
38
    }
39
40 3
    public function setStandardEntryClassCode(?string $standardEntryClassCode): self
41
    {
42 3
        $this->standardEntryClassCode = $standardEntryClassCode;
43
44 3
        return $this;
45
    }
46
47 6
    public function toArray(): array
48
    {
49 6
        $data = [];
50
51 6
        if ($this->payerSelected) {
52 3
            $data['payer_selected'] = $this->payerSelected;
53
        }
54
55 6
        if ($this->payeePreferred) {
56 2
            $data['payee_preferred'] = $this->payeePreferred;
57
        }
58
59 6
        if ($this->standardEntryClassCode) {
60 2
            $data['standard_entry_class_code'] = $this->standardEntryClassCode;
61
        }
62
63 6
        return $data;
64
    }
65
}
66