Completed
Pull Request — master (#2)
by
unknown
11:01
created
src/WebMoneyMerchantNotifier.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
     public function subscribe(Dispatcher $events)
15 15
     {
16 16
         // Listen events and send notification
17
-        $events->listen(WebMoneyMerchantEvent::class, function ($event) {
17
+        $events->listen(WebMoneyMerchantEvent::class, function($event) {
18 18
             $event->type = str_replace('webmoneymerchant.', '', $event->type);
19 19
 
20
-            if (! in_array($event->type, ['info', 'success', 'error'])) {
20
+            if (!in_array($event->type, ['info', 'success', 'error'])) {
21 21
                 $event->type = 'error';
22 22
             }
23 23
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             $notification = app(config('webmoney-merchant.notification'));
27 27
             $notification->setEvent($event);
28 28
 
29
-            if (! $this->isValidNotificationClass($notification)) {
29
+            if (!$this->isValidNotificationClass($notification)) {
30 30
                 throw InvalidConfiguration::notificationClassInvalid(get_class($notification));
31 31
             }
32 32
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $callable = config('webmoney-merchant.notificationFilter');
55 55
 
56
-        if (! is_callable($callable)) {
56
+        if (!is_callable($callable)) {
57 57
             return true;
58 58
         }
59 59
 
Please login to merge, or discard this patch.
src/WebMoneyMerchantNotification.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
         return $slack_message
53 53
             ->content('WebMoneyMerchant payment message from '.config('app.url'))
54
-            ->attachment(function (SlackAttachment $attachment) {
54
+            ->attachment(function(SlackAttachment $attachment) {
55 55
                 $attachment->fields([
56 56
                     'Title' => $this->event->title,
57 57
                     'IP' => $this->event->ip,
Please login to merge, or discard this patch.
config/webmoney-merchant.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     /*
25 25
      * Locale for the payment form
26 26
      */
27
-    'locale' => 'ru-RU',  // ru-RU || en-US
27
+    'locale' => 'ru-RU', // ru-RU || en-US
28 28
 
29 29
     /*
30 30
      *  SearchOrderFilter
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     'channels' => ['mail', 'slack'],
83 83
 
84 84
     'mail' => [
85
-        'to' => '',  // your email
85
+        'to' => '', // your email
86 86
     ],
87 87
 
88 88
     'slack' => [
Please login to merge, or discard this patch.
src/WebMoneyMerchantServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
         $this->app['events']->subscribe(WebMoneyMerchantNotifier::class);
36 36
 
37
-        $this->app->singleton('webmoneymerchant', function () {
37
+        $this->app->singleton('webmoneymerchant', function() {
38 38
             return $this->app->make('ActionM\WebMoneyMerchant\WebMoneyMerchant');
39 39
         });
40 40
 
Please login to merge, or discard this patch.
src/WebMoneyMerchant.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
     /**
17 17
      * Allow the access, if the ip address is in the whitelist.
18
-     * @param $ip
18
+     * @param string|null $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
      * Generates the '403' error code.
33
-     * @param $message
33
+     * @param string $message
34 34
      * @return mixed
35 35
      */
36 36
     public function responseError($message)
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 
50 50
     /**
51 51
      * Fills in the event details to pass the title and request params as array.
52
-     * @param $event_type
53
-     * @param $event_title
52
+     * @param string $event_type
53
+     * @param string $event_title
54 54
      * @param Request $request
55 55
      */
56 56
     public function eventFillAndSend($event_type, $event_title, Request $request)
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     /**
317 317
      * Calls PaidOrderFilter if the order is not paid.
318 318
      * @param Request $request
319
-     * @param $order
319
+     * @param boolean $order
320 320
      * @return mixed
321 321
      * @throws InvalidConfiguration
322 322
      */
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
         ];
136 136
 
137 137
         foreach ($required_fields as $key => $value) {
138
-            if (! array_key_exists($value, $order) || empty($order[$value])) {
138
+            if (!array_key_exists($value, $order) || empty($order[$value])) {
139 139
                 throw InvalidConfiguration::generatePaymentFormOrderParamsNotSet($value);
140 140
             }
141 141
         }
142 142
 
143 143
         // Checks if PAYMENT_NO is numeric.
144
-        if (! is_numeric($order['PAYMENT_NO'])) {
144
+        if (!is_numeric($order['PAYMENT_NO'])) {
145 145
             throw InvalidConfiguration::generatePaymentFormOrderInvalidPaymentNo('PAYMENT_NO');
146 146
         }
147 147
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
      */
238 238
     public function validateOrderRequestFromGate(Request $request)
239 239
     {
240
-        if (! $this->AllowIP($request->ip()) || ! $this->validate($request) || ! $this->validatePayeePurse($request) || ! $this->validateSignature($request)) {
240
+        if (!$this->AllowIP($request->ip()) || !$this->validate($request) || !$this->validatePayeePurse($request) || !$this->validateSignature($request)) {
241 241
             $this->eventFillAndSend('webmoneymerchant.error', 'validateOrderRequestFromGate', $request);
242 242
 
243 243
             return false;
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function validateSearchOrderRequiredAttributes(Request $request, $order)
256 256
     {
257
-        if (! $order) {
257
+        if (!$order) {
258 258
             $this->eventFillAndSend('webmoneymerchant.error', 'orderNotFound', $request);
259 259
 
260 260
             return false;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $attr = ['WEBMONEY_orderStatus', 'WEBMONEY_orderSum'];
265 265
 
266 266
         foreach ($attr as $k => $value) {
267
-            if (! $order->getAttribute($value)) {
267
+            if (!$order->getAttribute($value)) {
268 268
                 $this->eventFillAndSend('webmoneymerchant.error', $value.'Invalid', $request);
269 269
 
270 270
                 return false;
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
     {
292 292
         $callable = config('webmoney-merchant.searchOrderFilter');
293 293
 
294
-        if (! is_callable($callable)) {
294
+        if (!is_callable($callable)) {
295 295
             throw InvalidConfiguration::searchOrderFilterInvalid();
296 296
         }
297 297
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
         $order = $callable($request, $request->input('LMI_PAYMENT_NO'));
308 308
 
309
-        if (! $this->validateSearchOrderRequiredAttributes($request, $order)) {
309
+        if (!$this->validateSearchOrderRequiredAttributes($request, $order)) {
310 310
             return false;
311 311
         }
312 312
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     {
325 325
         $callable = config('webmoney-merchant.paidOrderFilter');
326 326
 
327
-        if (! is_callable($callable)) {
327
+        if (!is_callable($callable)) {
328 328
             throw InvalidConfiguration::orderPaidFilterInvalid();
329 329
         }
330 330
 
@@ -347,12 +347,12 @@  discard block
 block discarded – undo
347 347
             return 'YES';
348 348
         }
349 349
 
350
-        if (! $request->has('LMI_HASH')) {
350
+        if (!$request->has('LMI_HASH')) {
351 351
             return 'OK';
352 352
         }
353 353
 
354 354
         // Validates the request params from the WebMoney Merchant server.
355
-        if (! $this->validateOrderRequestFromGate($request)) {
355
+        if (!$this->validateOrderRequestFromGate($request)) {
356 356
             $this->eventFillAndSend('webmoneymerchant.error', 'validateOrderRequestFromGate', $request);
357 357
 
358 358
             return $this->responseError('validateOrderRequestFromGate');
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         // Searches and returns the order
362 362
         $order = $this->callFilterSearchOrder($request);
363 363
 
364
-        if (! $order) {
364
+        if (!$order) {
365 365
             $this->eventFillAndSend('webmoneymerchant.error', 'searchOrderFilter', $request);
366 366
 
367 367
             return $this->responseError('searchOrderFilter');
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
         // PaidOrderFilter - update the order into the DB as paid & other actions.
383 383
         // If it returns false, then some error has occurred.
384
-        if (! $this->callFilterPaidOrder($request, $order)) {
384
+        if (!$this->callFilterPaidOrder($request, $order)) {
385 385
             $this->eventFillAndSend('webmoneymerchant.error', 'callFilterPaidOrder', $request);
386 386
 
387 387
             return $this->responseError('callFilterPaidOrder');
Please login to merge, or discard this patch.