Passed
Pull Request — 2.x (#47)
by Darío
05:07 queued 02:35
created

PaymentMethod::getPayeePreferred()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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