Completed
Push — master ( 3380b3...070995 )
by Action
02:30
created
src/UnitPay.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
     /**
17 17
      * Allow if ip address is in whitelist.
18
-     * @param $ip
18
+     * @param string $ip
19 19
      * @return bool
20 20
      */
21 21
     public function allowIP($ip)
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     /**
32 32
      * Return json error result.
33
-     * @param $message
33
+     * @param string $message
34 34
      * @return mixed
35 35
      */
36 36
     public function responseError($message)
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     /**
44 44
      * Return json success result.
45
-     * @param $message
45
+     * @param string $message
46 46
      * @return mixed
47 47
      */
48 48
     public function responseOK($message)
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 
55 55
     /**
56 56
      * Fill event details to pass title and request params as array.
57
-     * @param $event_type
58
-     * @param $event_title
57
+     * @param string $event_type
58
+     * @param string $event_title
59 59
      * @param Request $request
60 60
      */
61 61
     public function eventFillAndSend($event_type, $event_title, Request $request)
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
     /**
307 307
      * Call PaidOrderFilter if order not paid.
308 308
      * @param Request $request
309
-     * @param $order
309
+     * @param boolean $order
310 310
      * @return mixed
311 311
      * @throws InvalidConfiguration
312 312
      */
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         ];
145 145
 
146 146
         foreach ($required_fields as $key => $value) {
147
-            if (! array_key_exists($value, $order) || empty($order[$value])) {
147
+            if (!array_key_exists($value, $order) || empty($order[$value])) {
148 148
                 throw InvalidConfiguration::generatePaymentFormOrderParamsNotSet($value);
149 149
             }
150 150
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             'USD',
158 158
         ];
159 159
 
160
-        if (! in_array($order['CURRENCY'], $currency_arr)) {
160
+        if (!in_array($order['CURRENCY'], $currency_arr)) {
161 161
             throw InvalidConfiguration::generatePaymentFormOrderInvalidCurrency($order['CURRENCY']);
162 162
         }
163 163
     }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function validateOrderRequestFromGate(Request $request)
243 243
     {
244
-        if (! $this->AllowIP($request->ip()) || ! $this->validate($request) || ! $this->validateSignature($request)) {
244
+        if (!$this->AllowIP($request->ip()) || !$this->validate($request) || !$this->validateSignature($request)) {
245 245
             $this->eventFillAndSend('unitpay.error', 'validateOrderRequestFromGate', $request);
246 246
 
247 247
             return false;
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     {
261 261
         $callable = config('unitpay.SearchOrderFilter');
262 262
 
263
-        if (! is_callable($callable)) {
263
+        if (!is_callable($callable)) {
264 264
             throw InvalidConfiguration::searchOrderFilterInvalid();
265 265
         }
266 266
 
@@ -276,25 +276,25 @@  discard block
 block discarded – undo
276 276
 
277 277
         $order = $callable($request, $request->input('params.account'));
278 278
 
279
-        if (! $order) {
279
+        if (!$order) {
280 280
             $this->eventFillAndSend('unitpay.error', 'orderNotFound', $request);
281 281
 
282 282
             return false;
283 283
         }
284 284
 
285
-        if (! array_key_exists('orderStatus', $order)) {
285
+        if (!array_key_exists('orderStatus', $order)) {
286 286
             $this->eventFillAndSend('unitpay.error', 'orderStatusInvalid', $request);
287 287
 
288 288
             return false;
289 289
         }
290 290
 
291
-        if (! array_key_exists('orderSum', $order) && $request->input('params.orderSum') != $order['orderSum']) {
291
+        if (!array_key_exists('orderSum', $order) && $request->input('params.orderSum') != $order['orderSum']) {
292 292
             $this->eventFillAndSend('unitpay.error', 'orderSumInvalid', $request);
293 293
 
294 294
             return false;
295 295
         }
296 296
 
297
-        if (! array_key_exists('orderCurrency', $order) && $request->input('params.orderCurrency') != $order['orderCurrency']) {
297
+        if (!array_key_exists('orderCurrency', $order) && $request->input('params.orderCurrency') != $order['orderCurrency']) {
298 298
             $this->eventFillAndSend('unitpay.error', 'orderCurrencyInvalid', $request);
299 299
 
300 300
             return false;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     {
315 315
         $callable = config('unitpay.PaidOrderFilter');
316 316
 
317
-        if (! is_callable($callable)) {
317
+        if (!is_callable($callable)) {
318 318
             throw InvalidConfiguration::orderPaidFilterInvalid();
319 319
         }
320 320
 
@@ -330,14 +330,14 @@  discard block
 block discarded – undo
330 330
     public function payOrderFromGate(Request $request)
331 331
     {
332 332
         // Validate request params from UnitPay server.
333
-        if (! $this->validateOrderRequestFromGate($request)) {
333
+        if (!$this->validateOrderRequestFromGate($request)) {
334 334
             return $this->responseError('validateOrderRequestFromGate');
335 335
         }
336 336
 
337 337
         // Search and return order
338 338
         $order = $this->callFilterSearchOrder($request);
339 339
 
340
-        if (! $order) {
340
+        if (!$order) {
341 341
             return $this->responseError('searchOrderFilter');
342 342
         }
343 343
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
         // PaidOrderFilter - update order into DB as paid & other actions
369 369
         // if return false then error
370
-        if (! $this->callFilterPaidOrder($request, $order)) {
370
+        if (!$this->callFilterPaidOrder($request, $order)) {
371 371
             $this->eventFillAndSend('unitpay.error', 'callFilterPaidOrder', $request);
372 372
 
373 373
             return $this->responseError('callFilterPaidOrder');
Please login to merge, or discard this patch.
src/UnitPayServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         $this->app['events']->subscribe(UnitPayNotifier::class);
37 37
 
38
-        $this->app->singleton('unitpay', function () {
38
+        $this->app->singleton('unitpay', function() {
39 39
             return $this->app->make('ActionM\UnitPay\UnitPay');
40 40
         });
41 41
 
@@ -50,16 +50,16 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function testingEnv()
52 52
     {
53
-        if (! App::environment('testing')) {
53
+        if (!App::environment('testing')) {
54 54
             $callable = config('unitpay.searchOrderFilter');
55 55
 
56
-            if (! is_callable($callable)) {
56
+            if (!is_callable($callable)) {
57 57
                 throw InvalidConfiguration::searchOrderFilterInvalid();
58 58
             }
59 59
 
60 60
             $callable = config('unitpay.paidOrderFilter');
61 61
 
62
-            if (! is_callable($callable)) {
62
+            if (!is_callable($callable)) {
63 63
                 throw InvalidConfiguration::orderPaidFilterInvalid();
64 64
             }
65 65
         }
Please login to merge, or discard this patch.