Passed
Push — feature/crete-subscription ( 54efc4 )
by Darío
07:19
created

PaymentMethod   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

7 Methods

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