Passed
Pull Request — master (#22)
by
unknown
04:52
created
Model/Ui/ConfigProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
         foreach ($items as $key => $item) {
108 108
             $promotedProduct = $this->isPromoted($item);
109 109
             if ($promotedProduct == 'true') {
110
-                $promotedAmount+=$item->getPrice()*$item->getQty();
110
+                $promotedAmount += $item->getPrice() * $item->getQty();
111 111
             }
112 112
         }
113 113
 
Please login to merge, or discard this patch.
Controller/Notify/IndexV2.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             $this->checkPagantisStatus(array('AUTHORIZED'));
266 266
         } catch (\Exception $e) {
267 267
             $this->getMagentoOrderId();
268
-            if ($this->magentoOrderId!='') {
268
+            if ($this->magentoOrderId != '') {
269 269
                 throw new AlreadyProcessedException();
270 270
             } else {
271 271
                 throw new WrongStatusException($this->pagantisOrder->getStatus());
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     private function checkMerchantOrderStatus()
280 280
     {
281
-        if ($this->quote->getIsActive()=='0') {
281
+        if ($this->quote->getIsActive() == '0') {
282 282
             $this->getMagentoOrderId();
283 283
             throw new AlreadyProcessedException();
284 284
         }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
             $tableName    = $this->dbObject->getTableName(self::CONCURRENCY_TABLE);
401 401
             if ($mode == false) {
402 402
                 $dbConnection->delete($tableName, "timestamp<".(time() - 5));
403
-            } elseif ($this->quoteId!='') {
403
+            } elseif ($this->quoteId != '') {
404 404
                 $dbConnection->delete($tableName, "id=".$this->quoteId);
405 405
             }
406 406
         } catch (Exception $exception) {
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
456 456
             $dbConnection = $this->dbObject->getConnection();
457 457
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
458
-            $pagantisOrderId   = $this->pagantisOrderId;
458
+            $pagantisOrderId = $this->pagantisOrderId;
459 459
             $query        = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'";
460 460
             $queryResult  = $dbConnection->fetchRow($query);
461 461
             $this->magentoOrderId = $queryResult['mg_order_id'];
@@ -480,14 +480,14 @@  discard block
 block discarded – undo
480 480
             $metadataInfo = null;
481 481
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
482 482
                 if ($metadataKey == 'promotedProduct') {
483
-                    $metadataInfo.= "/Producto promocionado = $metadataValue";
483
+                    $metadataInfo .= "/Producto promocionado = $metadataValue";
484 484
                 }
485 485
             }
486 486
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)->setIsCustomerNotified(false)->setEntityName('order')->save();
487 487
 
488
-            $comment = 'pagantisOrderId: ' . $this->pagantisOrder->getId(). ' ' .
489
-                       'pagantisOrderStatus: '. $this->pagantisOrder->getStatus(). ' ' .
490
-                       'via: '. $this->origin;
488
+            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
489
+                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '.
490
+                       'via: '.$this->origin;
491 491
             $this->magentoOrder->addStatusHistoryComment($comment)->setIsCustomerNotified(false)->setEntityName('order')->save();
492 492
             if ($this->magentoOrderId == '') {
493 493
                 throw new UnknownException('Order can not be saved');
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
507 507
             $dbConnection = $this->dbObject->getConnection();
508 508
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
509
-            $pagantisOrderId   = $this->pagantisOrder->getId();
509
+            $pagantisOrderId = $this->pagantisOrder->getId();
510 510
             $dbConnection->update(
511 511
                 $tableName,
512 512
                 array('mg_order_id' => $this->magentoOrderId),
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
     {
540 540
         //$returnUrl = 'checkout/#payment';
541 541
         $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']);
542
-        if ($this->magentoOrderId!='') {
542
+        if ($this->magentoOrderId != '') {
543 543
             /** @var Order $this->magentoOrder */
544 544
             $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);
545 545
             if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
             $orderStatus    = strtolower($this->magentoOrder->getStatus());
557 557
             $acceptedStatus = array('processing', 'completed');
558 558
             if (in_array($orderStatus, $acceptedStatus)) {
559
-                if (isset($this->extraConfig['PAGANTIS_OK_URL']) &&  $this->extraConfig['PAGANTIS_OK_URL']!= '') {
559
+                if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') {
560 560
                     $returnUrl = $this->extraConfig['PAGANTIS_OK_URL'];
561 561
                 } else {
562 562
                     $returnUrl = 'checkout/onepage/success';
Please login to merge, or discard this patch.
Controller/Notify/Index.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
             $this->checkPagantisStatus(array('AUTHORIZED'));
267 267
         } catch (\Exception $e) {
268 268
             $this->getMagentoOrderId();
269
-            if ($this->magentoOrderId!='') {
269
+            if ($this->magentoOrderId != '') {
270 270
                 throw new AlreadyProcessedException();
271 271
             } else {
272 272
                 throw new WrongStatusException($this->pagantisOrder->getStatus());
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      */
280 280
     private function checkMerchantOrderStatus()
281 281
     {
282
-        if ($this->quote->getIsActive()=='0') {
282
+        if ($this->quote->getIsActive() == '0') {
283 283
             $this->getMagentoOrderId();
284 284
             throw new AlreadyProcessedException();
285 285
         }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             $tableName    = $this->dbObject->getTableName(self::CONCURRENCY_TABLE);
402 402
             if ($mode == false) {
403 403
                 $dbConnection->delete($tableName, "timestamp<".(time() - 5));
404
-            } elseif ($this->quoteId!='') {
404
+            } elseif ($this->quoteId != '') {
405 405
                 $dbConnection->delete($tableName, "id=".$this->quoteId);
406 406
             }
407 407
         } catch (Exception $exception) {
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
457 457
             $dbConnection = $this->dbObject->getConnection();
458 458
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
459
-            $pagantisOrderId   = $this->pagantisOrderId;
459
+            $pagantisOrderId = $this->pagantisOrderId;
460 460
 
461 461
             $query        = "select mg_order_id from $tableName where id='$this->quoteId' and order_id='$pagantisOrderId'";
462 462
             $queryResult  = $dbConnection->fetchRow($query);
@@ -483,13 +483,13 @@  discard block
 block discarded – undo
483 483
             $metadataInfo = null;
484 484
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
485 485
                 if ($metadataKey == 'promotedProduct') {
486
-                    $metadataInfo.= "/Producto promocionado = $metadataValue";
486
+                    $metadataInfo .= "/Producto promocionado = $metadataValue";
487 487
                 }
488 488
             }
489 489
             $this->magentoOrder->addStatusHistoryComment($metadataInfo)->setIsCustomerNotified(false)->setEntityName('order')->save();
490 490
 
491
-            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId(). ' ' .
492
-                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus(). ' ' .
491
+            $comment = 'pagantisOrderId: '.$this->pagantisOrder->getId().' '.
492
+                       'pagantisOrderStatus: '.$this->pagantisOrder->getStatus().' '.
493 493
                        'via: '.$this->origin;
494 494
             $this->magentoOrder->addStatusHistoryComment($comment)->setIsCustomerNotified(false)->setEntityName('order')->save();
495 495
 
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
             /** @var \Magento\Framework\DB\Adapter\AdapterInterface $dbConnection */
511 511
             $dbConnection = $this->dbObject->getConnection();
512 512
             $tableName    = $this->dbObject->getTableName(self::ORDERS_TABLE);
513
-            $pagantisOrderId   = $this->pagantisOrder->getId();
513
+            $pagantisOrderId = $this->pagantisOrder->getId();
514 514
             $dbConnection->update(
515 515
                 $tableName,
516 516
                 array('mg_order_id' => $this->magentoOrderId),
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     {
544 544
         //$returnUrl = 'checkout/#payment';
545 545
         $returnUrl = $this->_url->getUrl('checkout', ['_fragment' => 'payment']);
546
-        if ($this->magentoOrderId!='') {
546
+        if ($this->magentoOrderId != '') {
547 547
             /** @var Order $this->magentoOrder */
548 548
             $this->magentoOrder = $this->orderRepositoryInterface->get($this->magentoOrderId);
549 549
             if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
             $orderStatus    = strtolower($this->magentoOrder->getStatus());
561 561
             $acceptedStatus = array('processing', 'completed');
562 562
             if (in_array($orderStatus, $acceptedStatus)) {
563
-                if (isset($this->extraConfig['PAGANTIS_OK_URL']) &&  $this->extraConfig['PAGANTIS_OK_URL']!= '') {
563
+                if (isset($this->extraConfig['PAGANTIS_OK_URL']) && $this->extraConfig['PAGANTIS_OK_URL'] != '') {
564 564
                     $returnUrl = $this->extraConfig['PAGANTIS_OK_URL'];
565 565
                 } else {
566 566
                     $returnUrl = 'checkout/onepage/success';
Please login to merge, or discard this patch.