Passed
Push — master ( 0fb964...a45573 )
by Action
02:42
created
src/UnitPay.php 1 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
     }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      */
243 243
     public function validateOrderRequestFromGate(Request $request)
244 244
     {
245
-        if (! $this->AllowIP($request->ip()) || ! $this->validate($request) || ! $this->validateSignature($request)) {
245
+        if (!$this->AllowIP($request->ip()) || !$this->validate($request) || !$this->validateSignature($request)) {
246 246
             $this->eventFillAndSend('unitpay.error', 'validateOrderRequestFromGate', $request);
247 247
 
248 248
             return false;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function validateSearchOrderRequiredAttributes(Request $request, $order)
261 261
     {
262
-        if (! $order) {
262
+        if (!$order) {
263 263
             $this->eventFillAndSend('unitpay.error', 'orderNotFound', $request);
264 264
 
265 265
             return false;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $attr = ['orderStatus', 'orderSum', 'orderCurrency'];
270 270
 
271 271
         foreach ($attr as $k => $value) {
272
-            if (! $order->getAttribute($value)) {
272
+            if (!$order->getAttribute($value)) {
273 273
                 $this->eventFillAndSend('unitpay.error', $value.'Invalid', $request);
274 274
 
275 275
                 return false;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     {
300 300
         $callable = config('unitpay.searchOrderFilter');
301 301
 
302
-        if (! is_callable($callable)) {
302
+        if (!is_callable($callable)) {
303 303
             throw InvalidConfiguration::searchOrderFilterInvalid();
304 304
         }
305 305
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
         $order = $callable($request, $request->input('params.account'));
317 317
 
318
-        if (! $this->validateSearchOrderRequiredAttributes($request, $order)) {
318
+        if (!$this->validateSearchOrderRequiredAttributes($request, $order)) {
319 319
             return false;
320 320
         }
321 321
 
@@ -333,12 +333,12 @@  discard block
 block discarded – undo
333 333
     {
334 334
         $callable = config('unitpay.paidOrderFilter');
335 335
 
336
-        if (! is_callable($callable)) {
336
+        if (!is_callable($callable)) {
337 337
             throw InvalidConfiguration::orderPaidFilterInvalid();
338 338
         }
339 339
 
340 340
         // unset the custom order attributes for Eloquent support
341
-        unset($order['orderSum'],$order['orderCurrency'],$order['orderStatus']);
341
+        unset($order['orderSum'], $order['orderCurrency'], $order['orderStatus']);
342 342
 
343 343
         // Run PaidOrderFilter callback
344 344
         return $callable($request, $order);
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
     public function payOrderFromGate(Request $request)
353 353
     {
354 354
         // Validate request params from UnitPay server.
355
-        if (! $this->validateOrderRequestFromGate($request)) {
355
+        if (!$this->validateOrderRequestFromGate($request)) {
356 356
             return $this->responseError('validateOrderRequestFromGate');
357 357
         }
358 358
 
359 359
         // Search and return order
360 360
         $order = $this->callFilterSearchOrder($request);
361 361
 
362
-        if (! $order) {
362
+        if (!$order) {
363 363
             return $this->responseError('searchOrderFilter');
364 364
         }
365 365
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 
390 390
         // PaidOrderFilter - update order into DB as paid & other actions
391 391
         // if return false then error
392
-        if (! $this->callFilterPaidOrder($request, $order)) {
392
+        if (!$this->callFilterPaidOrder($request, $order)) {
393 393
             $this->eventFillAndSend('unitpay.error', 'callFilterPaidOrder', $request);
394 394
 
395 395
             return $this->responseError('callFilterPaidOrder');
Please login to merge, or discard this patch.