YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/Magento/Synchronizer/Base.php

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function parseInventoryData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseInventoryData(\Vtiger_Record_Model $recordModel, array $item, Maps\Inventory $mapModel): array
    {
        $mapModel->setDataInv($item);
        $inventoryModel = \Vtiger_Inventory_Model::getInstance($recordModel->getModuleName());
        $inventoryRow = $inventoryModel->loadRowData($item['crmProductId'], ['currency' => $mapModel->dataCrm['currency_id']]);
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Base.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function saveInventoryCrm has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool
    {
        $inventoryData = [];
        $savedAllProducts = true;
        if ($mapModel->dataCrm['currency_id']) {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Base.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method parseInventoryData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function parseInventoryData(\Vtiger_Record_Model $recordModel, array $item, Maps\Inventory $mapModel): array
    {
        $mapModel->setDataInv($item);
        $inventoryModel = \Vtiger_Inventory_Model::getInstance($recordModel->getModuleName());
        $inventoryRow = $inventoryModel->loadRowData($item['crmProductId'], ['currency' => $mapModel->dataCrm['currency_id']]);
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Base.php - About 1 hr to fix

    Method saveInventoryCrm has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool
        {
            $inventoryData = [];
            $savedAllProducts = true;
            if ($mapModel->dataCrm['currency_id']) {
    Severity: Minor
    Found in app/Integrations/Magento/Synchronizer/Base.php - About 1 hr to fix

      The method parseInventoryData() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
      Open

          public function parseInventoryData(\Vtiger_Record_Model $recordModel, array $item, Maps\Inventory $mapModel): array
          {
              $mapModel->setDataInv($item);
              $inventoryModel = \Vtiger_Inventory_Model::getInstance($recordModel->getModuleName());
              $inventoryRow = $inventoryModel->loadRowData($item['crmProductId'], ['currency' => $mapModel->dataCrm['currency_id']]);

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

      The method saveInventoryCrm() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
      Open

          public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool
          {
              $inventoryData = [];
              $savedAllProducts = true;
              if ($mapModel->dataCrm['currency_id']) {

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

      Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
      Open

          public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
      Open

          public function parseInventoryData(\Vtiger_Record_Model $recordModel, array $item, Maps\Inventory $mapModel): array

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      The class Base has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
      Open

      abstract class Base
      {
          /**
           * Connector.
           *

      CouplingBetweenObjects

      Since: 1.1.0

      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

      Example

      class Foo {
          /**
           * @var \foo\bar\X
           */
          private $x = null;
      
          /**
           * @var \foo\bar\Y
           */
          private $y = null;
      
          /**
           * @var \foo\bar\Z
           */
          private $z = null;
      
          public function setFoo(\Foo $foo) {}
          public function setBar(\Bar $bar) {}
          public function setBaz(\Baz $baz) {}
      
          /**
           * @return \SplObjectStorage
           * @throws \OutOfRangeException
           * @throws \InvalidArgumentException
           * @throws \ErrorException
           */
          public function process(\Iterator $it) {}
      
          // ...
      }

      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

      Missing class import via use statement (line '225', column '14').
      Open

              $id = (new \App\Db\Query())->select(['productid'])->from('vtiger_products')

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Avoid using static access to class '\Vtiger_Inventory_Model' in method 'parseInventoryData'.
      Open

              $inventoryModel = \Vtiger_Inventory_Model::getInstance($recordModel->getModuleName());

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\App\Cache' in method 'findProduct'.
      Open

              if (\App\Cache::staticHas('ProductIdByEan', $ean)) {

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      The method parseInventoryData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                      } else {
                          $inventoryRow['discountparam'] = '{"aggregationType":"individual","individualDiscountType":"amount","individualDiscount":' . $mapModel->getInvFieldValue('discount') . '}';
                      }

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Avoid assigning values to variables in if clauses and the like (line '114', column '8').
      Open

          public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool
          {
              $inventoryData = [];
              $savedAllProducts = true;
              if ($mapModel->dataCrm['currency_id']) {

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

      The method saveInventoryCrm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $savedAllProducts = false;
              }

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Avoid using static access to class '\App\Cache' in method 'findProduct'.
      Open

                  return \App\Cache::staticGet('ProductIdByEan', $ean);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid assigning values to variables in if clauses and the like (line '111', column '84').
      Open

          public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool
          {
              $inventoryData = [];
              $savedAllProducts = true;
              if ($mapModel->dataCrm['currency_id']) {

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

      The method saveInventoryCrm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                      } else {
                          $savedAllProducts = false;
                          \App\Log::error('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])', 'Integrations/Magento');
                          $this->log('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])');
                          break;

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Avoid using static access to class '\App\Log' in method 'saveInventoryCrm'.
      Open

                          \App\Log::error('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])', 'Integrations/Magento');

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\App\Fields\DateTime' in method 'getFormattedTime'.
      Open

              return \DateTimeField::convertTimeZone($value, \App\Fields\DateTime::getTimeZone(), 'UTC')->format('Y-m-d H:i:s');

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\App\Cache' in method 'findProduct'.
      Open

              \App\Cache::staticSave('ProductIdByEan', $ean, $id);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      The method parseInventoryData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $value = $mapModel->getInvFieldValue($columnName);
                      if (null !== $value) {
                          $inventoryRow[$columnName] = $value;
                      } elseif (!isset($inventoryRow[$columnName])) {

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Define a constant instead of duplicating this literal "shipping" 6 times.
      Open

              if ($this->config->get('shipping_service_id') && !empty($data['shipping']['total'])) {

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "discountmode" 3 times.
      Open

                  } elseif ('discountmode' === $columnName) {

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "currency" 4 times.
      Open

              $inventoryRow = $inventoryModel->loadRowData($item['crmProductId'], ['currency' => $mapModel->dataCrm['currency_id']]);

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "ProductIdByEan" 3 times.
      Open

              if (\App\Cache::staticHas('ProductIdByEan', $ean)) {

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "total" 7 times.
      Open

                  if (\in_array($fieldModel->getColumnName(), ['name', 'total', 'margin', 'marginp', 'net', 'gross'])) {

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "taxmode" 3 times.
      Open

                  } elseif ('taxmode' === $columnName) {

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "currency_id" 4 times.
      Open

              if ($mapModel->dataCrm['currency_id']) {

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "discountparam" 3 times.
      Open

                          $inventoryRow['discountparam'] = '{"aggregationType":"individual","individualDiscountType":"percentage","individualDiscount":' . $item['discount_percent'] . '}';

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "shipping_amount" 3 times.
      Open

                  $tax = $data['shipping']['total']['shipping_amount'] > 0 ? ($data['shipping']['total']['shipping_tax_amount'] / $data['shipping']['total']['shipping_amount'] * 100) : 0;

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Call to undeclared method \App\Db\Query::select
      Open

              $id = (new \App\Db\Query())->select(['productid'])->from('vtiger_products')

      Call to undeclared method \App\Integrations\Magento\Synchronizer\Maps\Inventory::addAdditionalInvData
      Open

                  $additionalData = $mapModel->addAdditionalInvData();

      Argument 2 (sourceTimeZoneName) is string but \DateTimeField::convertTimeZone() takes \type defined at /code/include/fields/DateTimeField.php:253
      Open

              return \DateTimeField::convertTimeZone($value, \App\Fields\DateTime::getTimeZone(), 'UTC')->format('Y-m-d H:i:s');

      Call to method error from undeclared class \App\Log
      Open

                          \App\Log::error('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])', 'Integrations/Magento');

      Call to undeclared method \App\Db::createCommand
      Open

              \App\DB::getInstance('log')->createCommand()

      Argument 3 (targetTimeZoneName) is 'UTC' but \DateTimeField::convertTimeZone() takes \type defined at /code/include/fields/DateTimeField.php:253
      Open

              return \DateTimeField::convertTimeZone($value, \App\Fields\DateTime::getTimeZone(), 'UTC')->format('Y-m-d H:i:s');

      Argument 1 (time) is string but \DateTimeField::convertTimeZone() takes \type defined at /code/include/fields/DateTimeField.php:253
      Open

              return \DateTimeField::convertTimeZone($value, \App\Fields\DateTime::getTimeZone(), 'UTC')->format('Y-m-d H:i:s');

      Avoid variables with short names like $ex. Configured minimum length is 3.
      Open

          public function log(string $category, ?\Throwable $ex = null): void

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $id. Configured minimum length is 3.
      Open

              $id = (new \App\Db\Query())->select(['productid'])->from('vtiger_products')

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function __construct(\App\Integrations\Magento\Controller $controller)

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function getFormattedTime(string $value): string

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $savedAllProducts = true;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $productId = $mapModel->createProduct($item);

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $inventoryRow['discountmode'] = 1;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'discountmode' => 1,

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'taxmode' => 1,

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'currency' => $mapModel->dataCrm['currency_id'],

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'name' => $this->config->get('shipping_service_id'),

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'taxparam' => '{"aggregationType":"individual","individualTax":' . round($tax) . '}',

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $additionalData;

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Add log to db.

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'code' => $ex ? $ex->getCode() : 500,

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'trace' => $ex ? $ex->__toString() : null,

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Constructor.

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      if ($productId) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } else {

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ($savedAllProducts && !empty($inventoryData)) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $inventoryRow = $inventoryModel->loadRowData($item['crmProductId'], ['currency' => $mapModel->dataCrm['currency_id']]);

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  } elseif ('currency' === $columnName) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $inventoryRow[$columnName] = $value;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'discountparam' => '{"aggregationType":"individual","individualDiscountType":"amount","individualDiscount":' . $data['shipping']['total']['shipping_discount_amount'] . '}',

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $additionalData = $mapModel->addAdditionalInvData();

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function log(string $category, ?\Throwable $ex = null): void

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return void

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $inventoryRow['taxparam'] = '{"aggregationType":"individual","individualTax":' . $tax . '}';

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  } elseif ('discount' === $columnName) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'comment1' => '',

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Config.

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->config = $controller->config;

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return bool

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          \App\Log::error('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])', 'Integrations/Magento');

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Parse shipping data.

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Find product id by ean.

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function findProduct(string $ean): int

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'message' => $ex ? $ex->getMessage() : $category,

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      if (0 === $productId) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $savedAllProducts = false;

      Line exceeds 120 characters; contains 184 characters
      Open

                          \App\Log::error('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])', 'Integrations/Magento');

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $savedAllProducts = false;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if ($additionalData = $this->findAdditionalData($mapModel)) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $data = current($mapModel->data['extension_attributes']['shipping_assignments']);

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $config;

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $inventoryData = [];

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if (!empty($mapModel->data['extension_attributes']['shipping_assignments']) && ($shipping = $this->parseShippingData($mapModel))) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $inventoryData[] = $shipping;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $inventoryData[] = $additionalData;

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      } else {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      if (null !== $value) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ];

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (\App\Cache::staticHas('ProductIdByEan', $ean)) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $id = (new \App\Db\Query())->select(['productid'])->from('vtiger_products')

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ->innerJoin('vtiger_crmentity', 'vtiger_products.productid = vtiger_crmentity.crmid')

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'category' => $ex ? $category : 'info',

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Connector.

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Last scan config data.

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->controller = $controller;

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return \DateTimeField::convertTimeZone($value, \App\Fields\DateTime::getTimeZone(), 'UTC')->format('Y-m-d H:i:s');

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $item['crmProductId'] = $productId;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $inventoryData[] = $this->parseInventoryData($recordModel, $item, $mapModel);

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array

      Line exceeds 120 characters; contains 127 characters
      Open

              $inventoryRow = $inventoryModel->loadRowData($item['crmProductId'], ['currency' => $mapModel->dataCrm['currency_id']]);

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if (\in_array($fieldModel->getColumnName(), ['name', 'total', 'margin', 'marginp', 'net', 'gross'])) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      } elseif (!isset($inventoryRow[$columnName])) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  } elseif ('taxmode' === $columnName) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $inventoryRow['taxmode'] = 1;

      Line exceeds 120 characters; contains 181 characters
      Open

                          $inventoryRow['discountparam'] = '{"aggregationType":"individual","individualDiscountType":"percentage","individualDiscount":' . $item['discount_percent'] . '}';

      Line exceeds 120 characters; contains 181 characters
      Open

                  $tax = $data['shipping']['total']['shipping_amount'] > 0 ? ($data['shipping']['total']['shipping_tax_amount'] / $data['shipping']['total']['shipping_amount'] * 100) : 0;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'unit' => '',

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'subunit' => '',

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return \App\Cache::staticGet('ProductIdByEan', $ean);

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var \App\Integrations\Magento\Connector\Token

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param \App\Integrations\Magento\Controller $controller

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Return parsed time to magento time zone.

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $savedAllProducts;

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function parseInventoryData(\Vtiger_Record_Model $recordModel, array $item, Maps\Inventory $mapModel): array

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string      $category

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return void

      Spaces must be used to indent lines; tabs are not allowed
      Open

              \App\DB::getInstance('log')->createCommand()

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var array

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

          abstract public function process();

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return string

      Spaces must be used to indent lines; tabs are not allowed
      Open

          protected $connector;

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Line exceeds 120 characters; contains 122 characters
      Open

              return \DateTimeField::convertTimeZone($value, \App\Fields\DateTime::getTimeZone(), 'UTC')->format('Y-m-d H:i:s');

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->connector = $controller->getConnector();

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param \App\Integrations\Magento\Synchronizer\Maps\Inventory $mapModel

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $this->log('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])');

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Main function.

      Line exceeds 120 characters; contains 143 characters
      Open

                  if (!empty($mapModel->data['extension_attributes']['shipping_assignments']) && ($shipping = $this->parseShippingData($mapModel))) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param \Vtiger_Record_Model                                  $recordModel

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $inventoryRow['discountparam'] = '{"aggregationType":"individual","individualDiscountType":"amount","individualDiscount":' . $mapModel->getInvFieldValue('discount') . '}';

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param array                                                 $item

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $mapModel->setDataInv($item);

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ])->execute();

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $inventoryModel = \Vtiger_Inventory_Model::getInstance($recordModel->getModuleName());

      Line exceeds 120 characters; contains 191 characters
      Open

                          $inventoryRow['discountparam'] = '{"aggregationType":"individual","individualDiscountType":"amount","individualDiscount":' . $mapModel->getInvFieldValue('discount') . '}';

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $inventoryRow['currency'] = $mapModel->dataCrm['currency_id'];

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function parseShippingData(Maps\Inventory $mapModel): array

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'qty' => 1,

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return [];

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return int

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var \App\Integrations\Magento\Controller

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $value

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ($mapModel->dataCrm['currency_id']) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param \App\Integrations\Magento\Synchronizer\Maps\Inventory $mapModel

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if ('tax_percent' === $columnName || 'tax' === $columnName) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param ?\Throwable $ex

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      continue;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Parse additional data.

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function findAdditionalData(Maps\Inventory $mapModel): array

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $additionalData = [];

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

              \App\Cache::staticSave('ProductIdByEan', $ean, $id);

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ->insert('l_#__magento', [

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $lastScan = [];

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Save inventory elements.

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          break;

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param \Vtiger_Record_Model                                  $recordModel

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $tax = $item['tax_percent'] ?? round($item['tax_amount'] / $item['row_total'] * 100);

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  } elseif ('discountmode' === $columnName) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  } else {

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ($this->config->get('shipping_service_id') && !empty($data['shipping']['total'])) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $tax = $data['shipping']['total']['shipping_amount'] > 0 ? ($data['shipping']['total']['shipping_tax_amount'] / $data['shipping']['total']['shipping_amount'] * 100) : 0;

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param \App\Integrations\Magento\Synchronizer\Maps\Inventory $mapModel

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ->where(['vtiger_crmentity.deleted' => 0, 'vtiger_products.ean' => $ean])->scalar() ?: 0;

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $id;

      Line exceeds 120 characters; contains 182 characters
      Open

       * The file is part of the paid functionality. Using the file is allowed only after purchasing a subscription. File modification allowed only with the consent of the system producer.

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $productId = $this->findProduct(trim($item['sku']));

      Line exceeds 120 characters; contains 155 characters
      Open

                          $this->log('Skipped saving record, product not found in CRM (magento id: [' . $item['product_id'] . '] | SKU:[' . $item['sku'] . '])');

      Spaces must be used to indent lines; tabs are not allowed
      Open

              foreach ($inventoryModel->getFields() as $columnName => $fieldModel) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $inventoryRow[$columnName] = $fieldModel->getDefaultValue();

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'price' => $data['shipping']['total']['shipping_amount'],

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (method_exists($mapModel, 'addAdditionalInvData')) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $ean

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'time' => date('Y-m-d H:i:s'),

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var \App\Integrations\Magento\Config

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Controller.

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $controller;

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  foreach ($mapModel->data['items'] as $item) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      } else {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $recordModel->initInventoryData($inventoryData, false);

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Parse inventory data to YetiForce format.

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      if (empty($item['discount_amount']) && !empty($item['discount_percent'])) {

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $inventoryRow['discountparam'] = '{"aggregationType":"individual","individualDiscountType":"percentage","individualDiscount":' . $item['discount_percent'] . '}';

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $value = $mapModel->getInvFieldValue($columnName);

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $inventoryRow;

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param \App\Integrations\Magento\Synchronizer\Maps\Inventory $mapModel

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return [

      Line exceeds 120 characters; contains 188 characters
      Open

                      'discountparam' => '{"aggregationType":"individual","individualDiscountType":"amount","individualDiscount":' . $data['shipping']['total']['shipping_discount_amount'] . '}',

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'purchase' => 0,

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array

      There are no issues that match your filters.

      Category
      Status