Test Failed
Pull Request — master (#12)
by
unknown
03:48
created
src/Method/Payment/Payment.php 3 patches
Doc Comments   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
      */
409 409
     public function setThreeds2data(
410 410
         ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation
411
-    ){
411
+    ) {
412 412
         $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation;
413 413
     }
414 414
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
      */
427 427
     public function setThreeDS2AuthorizationInformation(
428 428
         ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation
429
-    ){
429
+    ) {
430 430
         $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation;
431 431
     }
432 432
 
Please login to merge, or discard this patch.
src/Method/Payment/Create.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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([
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -174,9 +174,15 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/Method/Payment/Finalize.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     private $authorizeData;
12 12
     private $finalizeKey;
13 13
 
14
-    public function __construct(string $paymentId, string $authorizeData, $isV2=false)
14
+    public function __construct(string $paymentId, string $authorizeData, $isV2 = false)
15 15
     {
16 16
         $this->paymentId = $paymentId;
17 17
         $this->authorizeData = $authorizeData;
Please login to merge, or discard this patch.