This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Getnet\API; |
||
4 | |||
5 | /** |
||
6 | * Class Card |
||
7 | * |
||
8 | * @package Getnet\API |
||
9 | */ |
||
10 | class Card implements \JsonSerializable |
||
11 | { |
||
12 | const BRAND_MASTERCARD = "Mastercard"; |
||
13 | const BRAND_VISA = "Visa"; |
||
14 | const BRAND_AMEX = "Amex"; |
||
15 | const BRAND_ELO = "Elo"; |
||
16 | const BRAND_HIPERCARD = "Hipercard"; |
||
17 | |||
18 | /** @var */ |
||
19 | private $brand; |
||
20 | |||
21 | /** @var */ |
||
22 | private $cardholder_name; |
||
23 | |||
24 | /** @var */ |
||
25 | private $expiration_month; |
||
26 | |||
27 | /** @var */ |
||
28 | private $expiration_year; |
||
29 | |||
30 | /** @var */ |
||
31 | private $number_token; |
||
32 | |||
33 | /** @var */ |
||
34 | private $security_code; |
||
35 | |||
36 | /** |
||
37 | * Card constructor. |
||
38 | * @param Token $token |
||
39 | */ |
||
40 | public function __construct(Token $token) |
||
41 | { |
||
42 | $this->setNumberToken($token); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | View Code Duplication | public function jsonSerialize() |
|
0 ignored issues
–
show
|
|||
50 | { |
||
51 | $vars = get_object_vars($this); |
||
52 | $vars_clear = array_filter($vars, function ($value) { |
||
53 | return null !== $value; |
||
54 | }); |
||
55 | |||
56 | return $vars_clear; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return mixed |
||
61 | */ |
||
62 | public function getBrand() |
||
63 | { |
||
64 | return $this->brand; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param $brand |
||
69 | * @return $this |
||
70 | */ |
||
71 | public function setBrand($brand) |
||
72 | { |
||
73 | $this->brand = (string)$brand; |
||
74 | |||
75 | return $this; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @return mixed |
||
80 | */ |
||
81 | public function getCardholderName() |
||
82 | { |
||
83 | return $this->cardholder_name; |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @param $cardholder_name |
||
88 | * @return $this |
||
89 | */ |
||
90 | public function setCardholderName($cardholder_name) |
||
91 | { |
||
92 | $this->cardholder_name = (string)$cardholder_name; |
||
93 | |||
94 | return $this; |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * @return mixed |
||
99 | */ |
||
100 | public function getExpirationMonth() |
||
101 | { |
||
102 | return $this->expiration_month; |
||
103 | } |
||
104 | |||
105 | /** |
||
106 | * @param $expiration_month |
||
107 | * @return $this |
||
108 | */ |
||
109 | public function setExpirationMonth($expiration_month) |
||
110 | { |
||
111 | $this->expiration_month = (string)$expiration_month; |
||
112 | |||
113 | return $this; |
||
114 | } |
||
115 | |||
116 | /** |
||
117 | * @return mixed |
||
118 | */ |
||
119 | public function getExpirationYear() |
||
120 | { |
||
121 | return $this->expiration_year; |
||
122 | } |
||
123 | |||
124 | /** |
||
125 | * @param $expiration_year |
||
126 | * @return $this |
||
127 | */ |
||
128 | public function setExpirationYear($expiration_year) |
||
129 | { |
||
130 | $this->expiration_year = (string)$expiration_year; |
||
131 | |||
132 | return $this; |
||
133 | } |
||
134 | |||
135 | /** |
||
136 | * @return mixed |
||
137 | */ |
||
138 | public function getNumberToken() |
||
139 | { |
||
140 | return $this->number_token; |
||
141 | } |
||
142 | |||
143 | /** |
||
144 | * @param $token |
||
145 | * @return $this |
||
146 | */ |
||
147 | public function setNumberToken($token) |
||
148 | { |
||
149 | $this->number_token = (string)$token->getNumberToken(); |
||
150 | |||
151 | return $this; |
||
152 | } |
||
153 | |||
154 | /** |
||
155 | * @return mixed |
||
156 | */ |
||
157 | public function getSecurityCode() |
||
158 | { |
||
159 | return $this->security_code; |
||
160 | } |
||
161 | |||
162 | /** |
||
163 | * @param $security_code |
||
164 | * @return $this |
||
165 | */ |
||
166 | public function setSecurityCode($security_code) |
||
167 | { |
||
168 | $this->security_code = (string)$security_code; |
||
169 | |||
170 | return $this; |
||
171 | } |
||
172 | |||
173 | /** |
||
174 | * @return false|string |
||
175 | */ |
||
176 | View Code Duplication | public function toJSON() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
177 | { |
||
178 | $vars = get_object_vars($this); |
||
179 | $vars_clear = array_filter($vars, function ($value) { |
||
180 | return null !== $value; |
||
181 | }); |
||
182 | |||
183 | return json_encode($vars_clear, JSON_PRETTY_PRINT); |
||
184 | } |
||
185 | } |
||
186 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.