Completed
Push — master ( 8a7d9d...5a9118 )
by Ronaldo
01:35
created

PayPalPaymentMethodTrait   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 156
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 13
lcom 0
cbo 0
dl 0
loc 156
ccs 32
cts 32
cp 1
rs 10
c 1
b 0
f 1

12 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaypalPayerId() 0 4 1
A setPaypalPayerId() 0 6 1
A getPaypalPayerEmail() 0 4 1
A setPaypalPayerEmail() 0 10 2
A getPaypalPayerStatus() 0 4 1
A setPaypalPayerStatus() 0 6 1
A getPaypalAddressStatus() 0 4 1
A setPaypalAddressStatus() 0 6 1
A getPaypalProtectionEligibility() 0 4 1
A setPaypalProtectionEligibility() 0 6 1
A getPaypalPaymentStatus() 0 4 1
A setPaypalPaymentStatus() 0 6 1
1
<?php
2
3
namespace WSW\SiftScience\Support\Traits\Entities;
4
5
use InvalidArgumentException;
6
7
/**
8
 * Trait PayPalPaymentMethodTrait
9
 *
10
 * @package WSW\SiftScience\Support\Traits\Entities
11
 * @author Ronaldo Matos Rodrigues <[email protected]>
12
 */
13
trait PayPalPaymentMethodTrait
14
{
15
    /**
16
     * @var string
17
     */
18
    private $paypalPayerId;
19
20
    /**
21
     * @var string
22
     */
23
    private $paypalPayerEmail;
24
25
    /**
26
     * @var string
27
     */
28
    private $paypalPayerStatus;
29
30
    /**
31
     * @var string
32
     */
33
    private $paypalAddressStatus;
34
35
    /**
36
     * @var string
37
     */
38
    private $paypalProtectionEligibility;
39
40
    /**
41
     * @var string
42
     */
43
    private $paypalPaymentStatus;
44
45
    /**
46
     * @return string
47
     */
48 1
    public function getPaypalPayerId()
49
    {
50 1
        return $this->paypalPayerId;
51
    }
52
53
    /**
54
     * @param string $paypalPayerId
55
     *
56
     * @return PayPalPaymentMethodTrait
1 ignored issue
show
Comprehensibility Bug introduced by
The return type PayPalPaymentMethodTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
57
     */
58 1
    public function setPaypalPayerId($paypalPayerId)
59
    {
60 1
        $this->paypalPayerId = $paypalPayerId;
61
62 1
        return $this;
63
    }
64
65
    /**
66
     * @return string
67
     */
68 1
    public function getPaypalPayerEmail()
69
    {
70 1
        return $this->paypalPayerEmail;
71
    }
72
73
    /**
74
     * @param string $paypalPayerEmail
75
     *
76
     * @return PayPalPaymentMethodTrait
1 ignored issue
show
Comprehensibility Bug introduced by
The return type PayPalPaymentMethodTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
77
     */
78 2
    public function setPaypalPayerEmail($paypalPayerEmail)
79
    {
80 2
        if (!filter_var($paypalPayerEmail, FILTER_VALIDATE_EMAIL)) {
81 1
            throw new InvalidArgumentException('You should inform a valid email');
82
        }
83
84 1
        $this->paypalPayerEmail = $paypalPayerEmail;
85
86 1
        return $this;
87
    }
88
89
    /**
90
     * @return string
91
     */
92 1
    public function getPaypalPayerStatus()
93
    {
94 1
        return $this->paypalPayerStatus;
95
    }
96
97
    /**
98
     * @param string $paypalPayerStatus
99
     *
100
     * @return PayPalPaymentMethodTrait
1 ignored issue
show
Comprehensibility Bug introduced by
The return type PayPalPaymentMethodTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
101
     */
102 1
    public function setPaypalPayerStatus($paypalPayerStatus)
103
    {
104 1
        $this->paypalPayerStatus = $paypalPayerStatus;
105
106 1
        return $this;
107
    }
108
109
    /**
110
     * @return string
111
     */
112 1
    public function getPaypalAddressStatus()
113
    {
114 1
        return $this->paypalAddressStatus;
115
    }
116
117
    /**
118
     * @param string $paypalAddressStatus
119
     *
120
     * @return PayPalPaymentMethodTrait
1 ignored issue
show
Comprehensibility Bug introduced by
The return type PayPalPaymentMethodTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
121
     */
122 1
    public function setPaypalAddressStatus($paypalAddressStatus)
123
    {
124 1
        $this->paypalAddressStatus = $paypalAddressStatus;
125
126 1
        return $this;
127
    }
128
129
    /**
130
     * @return string
131
     */
132 1
    public function getPaypalProtectionEligibility()
133
    {
134 1
        return $this->paypalProtectionEligibility;
135
    }
136
137
    /**
138
     * @param string $paypalProtectionEligibility
139
     *
140
     * @return PayPalPaymentMethodTrait
1 ignored issue
show
Comprehensibility Bug introduced by
The return type PayPalPaymentMethodTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
141
     */
142 1
    public function setPaypalProtectionEligibility($paypalProtectionEligibility)
143
    {
144 1
        $this->paypalProtectionEligibility = $paypalProtectionEligibility;
145
146 1
        return $this;
147
    }
148
149
    /**
150
     * @return string
151
     */
152 1
    public function getPaypalPaymentStatus()
153
    {
154 1
        return $this->paypalPaymentStatus;
155
    }
156
157
    /**
158
     * @param string $paypalPaymentStatus
159
     *
160
     * @return PayPalPaymentMethodTrait
1 ignored issue
show
Comprehensibility Bug introduced by
The return type PayPalPaymentMethodTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
161
     */
162 1
    public function setPaypalPaymentStatus($paypalPaymentStatus)
163
    {
164 1
        $this->paypalPaymentStatus = $paypalPaymentStatus;
165
166 1
        return $this;
167
    }
168
}
169