@@ -73,7 +73,7 @@ |
||
73 | 73 | { |
74 | 74 | $parts = explode('_', $field); |
75 | 75 | array_map('ucfirst', $parts); |
76 | - $name = 'set' . implode('', $parts); |
|
76 | + $name = 'set'.implode('', $parts); |
|
77 | 77 | |
78 | 78 | return $name; |
79 | 79 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | private function classGetters($class) |
107 | 107 | { |
108 | 108 | $methods = get_class_methods($class); |
109 | - return array_filter($methods, function ($value) use ($methods) { |
|
109 | + return array_filter($methods, function($value) use ($methods) { |
|
110 | 110 | if ($value == 'getErrors') { |
111 | 111 | return false; |
112 | 112 | } |
@@ -134,6 +134,6 @@ discard block |
||
134 | 134 | $parts = array_map('ucfirst', $parts); |
135 | 135 | $property = implode('', $parts); |
136 | 136 | |
137 | - return 'set' . ucfirst($property); |
|
137 | + return 'set'.ucfirst($property); |
|
138 | 138 | } |
139 | 139 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public function __construct($message, ConstraintViolationListInterface $violations) |
13 | 13 | { |
14 | - $message .= ' Violations: ' . $violations->__toString(); |
|
14 | + $message .= ' Violations: '.$violations->__toString(); |
|
15 | 15 | parent::__construct($message); |
16 | 16 | |
17 | 17 | $this->violations = $violations; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function __construct(\Exception $previous = null, ResultObjectInterface $result = null) |
17 | 17 | { |
18 | - $this->message .= ' Response data: ' . serialize($result); |
|
18 | + $this->message .= ' Response data: '.serialize($result); |
|
19 | 19 | parent::__construct($this->message, $this->code, $previous); |
20 | 20 | |
21 | 21 | $this->result = $result; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | /** |
92 | 92 | * Gets the value of id. |
93 | - * @return mixed |
|
93 | + * @return string |
|
94 | 94 | */ |
95 | 95 | public function getId() |
96 | 96 | { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | /** |
111 | 111 | * Gets the value of amount. |
112 | - * @return mixed |
|
112 | + * @return double |
|
113 | 113 | */ |
114 | 114 | public function getAmount() |
115 | 115 | { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | /** |
130 | 130 | * Gets the value of currency. |
131 | - * @return mixed |
|
131 | + * @return string |
|
132 | 132 | */ |
133 | 133 | public function getCurrency() |
134 | 134 | { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | /** |
149 | 149 | * Gets the value of created. |
150 | - * @return mixed |
|
150 | + * @return string |
|
151 | 151 | */ |
152 | 152 | public function getCreated() |
153 | 153 | { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | /** |
168 | 168 | * Gets the value of type. |
169 | - * @return mixed |
|
169 | + * @return string |
|
170 | 170 | */ |
171 | 171 | public function getType() |
172 | 172 | { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | /** |
187 | 187 | * Gets the value of live. |
188 | - * @return mixed |
|
188 | + * @return boolean |
|
189 | 189 | */ |
190 | 190 | public function getLive() |
191 | 191 | { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | /** |
206 | 206 | * Gets the value of settle. |
207 | - * @return mixed |
|
207 | + * @return boolean |
|
208 | 208 | */ |
209 | 209 | public function getSettle() |
210 | 210 | { |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | /** |
225 | 225 | * Gets the value of status. |
226 | - * @return mixed |
|
226 | + * @return string |
|
227 | 227 | */ |
228 | 228 | public function getStatus() |
229 | 229 | { |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | /** |
244 | 244 | * Gets the value of error. |
245 | - * @return mixed |
|
245 | + * @return string |
|
246 | 246 | */ |
247 | 247 | public function getError() |
248 | 248 | { |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | /** |
263 | 263 | * Gets the value of orderId. |
264 | - * @return mixed |
|
264 | + * @return string |
|
265 | 265 | */ |
266 | 266 | public function getOrderId() |
267 | 267 | { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | /** |
282 | 282 | * Gets the value of description. |
283 | - * @return mixed |
|
283 | + * @return string |
|
284 | 284 | */ |
285 | 285 | public function getDescription() |
286 | 286 | { |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | |
300 | 300 | /** |
301 | 301 | * Gets the value of country. |
302 | - * @return mixed |
|
302 | + * @return string |
|
303 | 303 | */ |
304 | 304 | public function getCountry() |
305 | 305 | { |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | |
319 | 319 | /** |
320 | 320 | * Gets the value of paymentMethod. |
321 | - * @return mixed |
|
321 | + * @return string |
|
322 | 322 | */ |
323 | 323 | public function getPaymentMethod() |
324 | 324 | { |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | /** |
358 | 358 | * @deprecated method is deprecated and shouldn't be used. |
359 | 359 | * Gets the value of authorizeData. |
360 | - * @return mixed |
|
360 | + * @return string |
|
361 | 361 | */ |
362 | 362 | public function getAuthorizeData() |
363 | 363 | { |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Cardinity\Method\Payment; |
4 | 4 | |
5 | 5 | use Cardinity\Method\ResultObject; |
6 | -use Cardinity\Method\Payment\ThreeDS2Data; |
|
7 | 6 | use Cardinity\Method\Payment\ThreeDS2AuthorizationInformation; |
8 | 7 | |
9 | 8 | class Payment extends ResultObject |
@@ -405,7 +405,7 @@ |
||
405 | 405 | */ |
406 | 406 | public function setThreeds2Data( |
407 | 407 | ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation |
408 | - ){ |
|
408 | + ) { |
|
409 | 409 | $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation; |
410 | 410 | } |
411 | 411 |
@@ -174,9 +174,15 @@ |
||
174 | 174 | 'message' => 'The value {{ value }} is not a valid {{ type }}.' |
175 | 175 | ]), |
176 | 176 | ]; |
177 | - if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); |
|
178 | - if ($length) array_push($inside_array, new Assert\Length($length)); |
|
179 | - if ($args) array_push($inside_array, $args); |
|
177 | + if ($isRequired) { |
|
178 | + array_unshift($inside_array, new Assert\NotBlank()); |
|
179 | + } |
|
180 | + if ($length) { |
|
181 | + array_push($inside_array, new Assert\Length($length)); |
|
182 | + } |
|
183 | + if ($args) { |
|
184 | + array_push($inside_array, $args); |
|
185 | + } |
|
180 | 186 | |
181 | 187 | return $isRequired |
182 | 188 | ? new Assert\Required($inside_array) |
@@ -166,6 +166,9 @@ |
||
166 | 166 | ]); |
167 | 167 | } |
168 | 168 | |
169 | + /** |
|
170 | + * @param string $typeValue |
|
171 | + */ |
|
169 | 172 | private function buildElement($typeValue, bool $isRequired=false, $length=0, $args=0) |
170 | 173 | { |
171 | 174 | $inside_array = [ |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | { |
44 | 44 | return new Assert\Collection([ |
45 | 45 | 'amount' => $this->buildElement('float', 1), |
46 | - 'currency' => $this->buildElement('string', 1, ['min' => 3,'max' => 3]), |
|
46 | + 'currency' => $this->buildElement('string', 1, ['min' => 3, 'max' => 3]), |
|
47 | 47 | 'settle' => $this->buildElement('bool'), |
48 | - 'order_id' => $this->buildElement('string', 0, ['min' => 2,'max' => 50]), |
|
48 | + 'order_id' => $this->buildElement('string', 0, ['min' => 2, 'max' => 50]), |
|
49 | 49 | 'description' => $this->buildElement('string', 0, ['max' => 255]), |
50 | - 'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]), |
|
50 | + 'country' => $this->buildElement('string', 1, ['min' => 2, 'max' => 2]), |
|
51 | 51 | 'payment_method' => new Assert\Required([ |
52 | 52 | new Assert\Type([ |
53 | 53 | 'type' => 'string', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ]), |
81 | 81 | 'exp_year' => $this->buildElement( |
82 | 82 | 'integer', 1, |
83 | - ['min' => 4,'max' => 4], |
|
83 | + ['min' => 4, 'max' => 4], |
|
84 | 84 | new Assert\Range(['min' => date('Y')]) |
85 | 85 | ), |
86 | 86 | 'exp_month' => $this->buildElement('integer', 1), |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | ]); |
167 | 167 | } |
168 | 168 | |
169 | - private function buildElement($typeValue, bool $isRequired=false, $length=0, $args=0) |
|
169 | + private function buildElement($typeValue, bool $isRequired = false, $length = 0, $args = 0) |
|
170 | 170 | { |
171 | 171 | $inside_array = [ |
172 | 172 | new Assert\Type([ |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @param STRING authorize data 'cres' or 'authorize_data' |
17 | 17 | * @param BOOL should it be 3D secure v2 ? |
18 | 18 | */ |
19 | - public function __construct(string $paymentId, string $authorizeData, $isV2=false) |
|
19 | + public function __construct(string $paymentId, string $authorizeData, $isV2 = false) |
|
20 | 20 | { |
21 | 21 | $this->paymentId = $paymentId; |
22 | 22 | $this->authorizeData = $authorizeData; |