Passed
Pull Request — 1.x (#36)
by Darío
04:17 queued 02:03
created

PaymentMethod::getStandardEntryClassCode()   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 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): self
17
    {
18
        $this->payerSelected = $payerSelected;
19
20
        return $this;
21
    }
22
23
    public function getPayeePreferred(): ?string
24
    {
25
        return $this->payeePreferred;
26
    }
27
28
    public function setPayeePreferred(?string $payeePreferred): self
29
    {
30
        $this->payeePreferred = $payeePreferred;
31
32
        return $this;
33
    }
34
35
    public function getStandardEntryClassCode(): ?string
36
    {
37
        return $this->standardEntryClassCode;
38
    }
39
40
    public function setStandardEntryClassCode(?string $standardEntryClassCode): self
41
    {
42
        $this->standardEntryClassCode = $standardEntryClassCode;
43
44
        return $this;
45
    }
46
47
    public function toArray(): array
48
    {
49
        $data = [];
50
51
        if ($this->payerSelected) {
52
            $data['payer_selected'] = $this->payerSelected;
53
        }
54
55
        if ($this->payeePreferred) {
56
            $data['payee_preferred'] = $this->payeePreferred;
57
        }
58
59
        if ($this->standardEntryClassCode) {
60
            $data['standard_entry_class_code'] = $this->standardEntryClassCode;
61
        }
62
63
        return $data;
64
    }
65
}
66