YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/Wapro/Synchronizer/Invoice.php

Summary

Maintainability
C
1 day
Test Coverage
F
0%

The class Invoice has an overall complexity of 51 which is very high. The configured complexity threshold is 50.
Open

class Invoice extends \App\Integrations\Wapro\Synchronizer
{
    /** {@inheritdoc} */
    const NAME = 'LBL_INVOICE';

Function loadInventory has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loadInventory(): void
    {
        $inventory = $this->getInventory();
        if (!$this->recordModel->isNew()) {
            $oldInventory = $this->recordModel->getInventoryData();
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/Invoice.php - About 3 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 process has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): int
    {
        $query = (new \App\Db\Query())->select([
            'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
            'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/Invoice.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 process has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(): int
    {
        $query = (new \App\Db\Query())->select([
            'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
            'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/Invoice.php - About 1 hr to fix

    Method getInventory has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getInventory(): array
        {
            $currencyId = $this->getBaseCurrency()['currencyId'];
            if (!empty($this->row['DOK_WAL'])) {
                $currencyId = $this->convertCurrency($this->row['SYM_WAL'], []);
    Severity: Minor
    Found in app/Integrations/Wapro/Synchronizer/Invoice.php - About 1 hr to fix

      Function getCurrencyParam has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function getCurrencyParam(int $currencyId): array
          {
              $baseCurrency = $this->getBaseCurrency();
              $defaultCurrencyId = $baseCurrency['default']['id'];
              if (!empty($this->row['DATA_KURS_WAL'])) {
      Severity: Minor
      Found in app/Integrations/Wapro/Synchronizer/Invoice.php - About 25 mins 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

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

          protected function loadInventory(): void
          {
              $inventory = $this->getInventory();
              if (!$this->recordModel->isNew()) {
                  $oldInventory = $this->recordModel->getInventoryData();

      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 process() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
      Open

          public function process(): int
          {
              $query = (new \App\Db\Query())->select([
                  'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
                  'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',

      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 25 to the 15 allowed.
      Open

          protected function loadInventory(): void

      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

      Missing class import via use statement (line '239', column '22').
      Open

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

      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

      Missing class import via use statement (line '49', column '17').
      Open

              $query = (new \App\Db\Query())->select([

      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

      Missing class import via use statement (line '329', column '15').
      Open

              return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());

      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

      Missing class import via use statement (line '174', column '15').
      Open

              $row = (new \App\Db\Query())->select(['dbo.MIEJSCE_DOSTAWY.*'])->from('dbo.DOSTAWA')

      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 '\App\Record' in method 'loadInventory'.
      Open

                  $this->recordModel->set('subject', \App\Record::getLabel($inventory[0]['name'], true) ?: '-');

      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\Pauser' in method 'process'.
      Open

              $pauser = \App\Pauser::getInstance('WaproInvoiceLastId');

      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\Json' in method 'getInventory'.
      Open

              $currencyParam = \App\Json::encode($this->getCurrencyParam($currencyId));

      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 '59', column '7').
      Open

          public function process(): int
          {
              $query = (new \App\Db\Query())->select([
                  'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
                  'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',

      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

      Avoid using static access to class '\vtlib\Functions' in method 'getCurrencyParam'.
      Open

                  $date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));

      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 '\Vtiger_Record_Model' in method 'importRecord'.
      Open

                  $this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'FInvoice');

      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\Json' in method 'getInventory'.
      Open

                      'discountparam' => \App\Json::encode([
                          'aggregationType' => ['individual', 'additional'],
                          'individualDiscount' => empty((float) $row['RABAT']) ? 0 : (-$row['RABAT']),
                          'individualDiscountType' => 'percentage',
                          'additionalDiscount' => empty((float) $row['RABAT2']) ? 0 : (-$row['RABAT2']),

      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 getCurrencyParam uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));
              }

      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\Json' in method 'getInventory'.
      Open

                      'taxparam' => \App\Json::encode(
                          $this->getGlobalTax($row['KOD_VAT']) ? [
                              'aggregationType' => 'global',
                              'globalTax' => (float) $row['KOD_VAT'],
                          ] : [

      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 '103', column '7').
      Open

          public function importRecord(): int
          {
              if ($id = $this->findInMapTable($this->waproId, 'DOKUMENT_HANDLOWY')) {
                  $this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'FInvoice');
              } else {

      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 importRecord uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $this->recordModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');
                  $this->recordModel->setDataForSave([\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME => [
                      'wtable' => 'DOKUMENT_HANDLOWY',
                  ]]);

      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

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

                  } else {
                      $info['value'] = round($this->row['PRZELICZNIK_WAL'], 5);
                      $info['conversion'] = round(1 / $this->row['PRZELICZNIK_WAL'], 5);
                  }

      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 'importRecord'.
      Open

              \App\Cache::save('WaproMapTable', "{$this->waproId}|DOKUMENT_HANDLOWY", $this->recordModel->getId());

      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 '\Vtiger_Record_Model' in method 'importRecord'.
      Open

                  $this->recordModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');

      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

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

                          'aggregationType' => ['individual', 'additional'],

      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 "ID_DOKUMENTU_HANDLOWEGO" 3 times.
      Open

                  'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',

      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 "fieldName" 11 times.
      Open

              'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],

      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 "DOK_WAL" 3 times.
      Open

                  'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',

      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.

      Move this "case default" clause to the end of this "switch" statement.
      Open

                              default:

      The requirement for a final case default clause is defensive programming. The clause should either take appropriate action, or contain a suitable comment as to why no action is taken. Even when the switch covers all current values of an enum, a default case should still be used because there is no guarantee that the enum won't be extended.

      Noncompliant Code Example

      switch ($param) {  //missing default clause
        case 0:
          do_something();
          break;
        case 1:
          do_something_else();
          break;
      }
      
      switch ($param) {
        default: // default clause should be the last one
          error();
          break;
        case 0:
          do_something();
          break;
        case 1:
          do_something_else();
          break;
      }
      

      Compliant Solution

      switch ($param) {
        case 0:
          do_something();
          break;
        case 1:
          do_something_else();
          break;
        default:
          error();
          break;
      }
      

      See

      • MISRA C:2004, 15.0 - The MISRA C switch syntax shall be used.
      • MISRA C:2004, 15.3 - The final clause of a switch statement shall be the default clause
      • MISRA C++:2008, 6-4-3 - A switch statement shall be a well-formed switch statement.
      • MISRA C++:2008, 6-4-6 - The final clause of a switch statement shall be the default-clause
      • MISRA C:2012, 16.1 - All switch statements shall be well-formed
      • MISRA C:2012, 16.4 - Every switch statement shall have a default label
      • MISRA C:2012, 16.5 - A default label shall appear as either the first or the last switch label of a switch statement
      • MITRE, CWE-478 - Missing Default Case in Switch Statement
      • CERT, MSC01-C. - Strive for logical completeness
      • CERT, MSC01-CPP. - Strive for logical completeness

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

              'issueTime' => ['fieldName' => 'issue_time', 'fn' => 'convertDate'],

      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 "PRZELICZNIK_WAL" 3 times.
      Open

                  if (empty($this->row['PRZELICZNIK_WAL'])) {

      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 "value" 3 times.
      Open

                  $defaultCurrencyId => ['date' => $date, 'value' => 1.0, 'conversion' => 1.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.

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

              'saleDate' => ['fieldName' => 'saledate', 'fn' => 'convertDate'],

      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 "KOD_VAT" 4 times.
      Open

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

      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 "ID_ARTYKULU" 3 times.
      Open

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

      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 "RABAT2" 3 times.
      Open

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

      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 "conversion" 3 times.
      Open

                  $defaultCurrencyId => ['date' => $date, 'value' => 1.0, 'conversion' => 1.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.

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

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

      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 "tableName" 3 times.
      Open

              'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],

      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.

      Avoid unused parameters such as '$params'.
      Open

          protected function convertDate(string $value, array $params): string

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

              return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());

      Argument 1 (from) is int but \Settings_CurrencyUpdate_Module_Model::getCRMConversionRate() takes string defined at /code/modules/Settings/CurrencyUpdate/models/Module.php:274
      Open

                      $value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);

      Call to undeclared method \App\Integrations\Wapro\Synchronizer::importRecordById
      Open

              return $this->controller->getSynchronizer('Products')->importRecordById($id);

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

              $row = (new \App\Db\Query())->select(['dbo.MIEJSCE_DOSTAWY.*'])->from('dbo.DOSTAWA')

      Argument 1 (value) is int but \App\Pauser::setValue() takes string defined at /code/app/Pauser.php:77
      Open

                  $pauser->setValue($lastId);

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

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

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

              $query = (new \App\Db\Query())->select([

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

              $lastId = $s = $e = $i = $u = 0;

      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 $i. Configured minimum length is 3.
      Open

              $lastId = $s = $e = $i = $u = 0;

      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

          protected function addProduct(int $id): int

      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 $s. Configured minimum length is 3.
      Open

              $lastId = $s = $e = $i = $u = 0;

      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 $e. Configured minimum length is 3.
      Open

              $lastId = $s = $e = $i = $u = 0;

      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

              if ($id = $this->findInMapTable($this->waproId, 'DOKUMENT_HANDLOWY')) {

      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

              'paymentDate' => ['fieldName' => 'paymentdate', 'fn' => 'convertDate'],

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

          {

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

              $lastId = $s = $e = $i = $u = 0;

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

                      $this->waproId = $row['ID_DOKUMENTU_HANDLOWEGO'];

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

                      $this->row = $row;

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

                          switch ($this->importRecord()) {

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

                                  ++$s;

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

                                  ++$i;

      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

                          $this->logError($th);

      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

                      'wtable' => 'DOKUMENT_HANDLOWY',

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

              $this->loadInventory();

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

              return 2;

      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

           */

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

          /** @var string[] Map for payment methods with WAPRO ERP */

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

          /** {@inheritdoc} */

      Line exceeds 120 characters; contains 134 characters
      Open

              'ID_KONTRAHENTA' => ['fieldName' => 'accountid', 'fn' => 'findRelationship', 'tableName' => 'KONTRAHENT', 'skipMode' => true],

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

              'FORMA_PLATNOSCI' => ['fieldName' => 'payment_methods', 'fn' => 'convertPaymentMethods'],

      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

                  $this->recordModel->setDataForSave([\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME => [

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

              \App\Cache::save('WaproMapTable', "{$this->waproId}|DOKUMENT_HANDLOWY", $this->recordModel->getId());

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

          const SEQUENCE = 5;

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

              'gotówka' => 'PLL_CASH',

      Line exceeds 120 characters; contains 128 characters
      Open

              'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],

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

          public function process(): int

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

          /** {@inheritdoc} */

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

              }

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

           * Convert payment method to system format.

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

              if (isset(self::PAYMENT_METHODS_MAP[$value])) {

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

                  return self::PAYMENT_METHODS_MAP[$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

              return $key ?? '';

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

              'czek' => 'PLL_CHECK',

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

                  foreach ($rows as $row) {

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

                          $lastId = $this->waproId;

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

                  $this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'FInvoice');

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

              $this->recordModel->set('finvoice_status', 'PLL_UNASSIGNED');

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

              $this->loadFromFieldMap();

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

              $this->recordModel->save();

      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

          /** {@inheritdoc} */

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

          /** {@inheritdoc} */

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

                  'currencyDate' => 'cast (dbo.DOKUMENT_HANDLOWY.DATA_KURS_WAL - 36163 as datetime)',

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

              ])->from('dbo.DOKUMENT_HANDLOWY')

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

                              default:

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

                              case 2:

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

              if (0 == $lastId) {

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

          public function importRecord(): 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

              $this->recordModel->set('wapro_id', $this->waproId);

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

              $this->loadDeliveryAddress('b');

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

          }

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

                  $key = $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

              $pauser = \App\Pauser::getInstance('WaproInvoiceLastId');

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

              return $i + $u;

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

              $fieldModel = $this->recordModel->getField($params['fieldName']);

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

              'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],

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

              'saleDate' => ['fieldName' => 'saledate', 'fn' => 'convertDate'],

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

                  'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',

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

                              case 0:

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

          const PAYMENT_METHODS_MAP = [

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

          protected $fieldMap = [

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

              'KONTRAHENT_NAZWA' => ['fieldName' => 'company_name_a', 'fn' => 'decode'],

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

              $query = (new \App\Db\Query())->select([

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

                  'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',

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

                  $pauser->destroy();

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

          {

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

                  $this->recordModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');

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

              if ($id) {

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

              $key = array_search(mb_strtolower($value), array_map('mb_strtolower', $fieldModel->getPicklistValues()));

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

              if (empty($key)) {

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

              'issueTime' => ['fieldName' => 'issue_time', 'fn' => 'convertDate'],

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

                      try {

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

                  if ($this->controller->cron && $this->controller->cron->checkTimeout()) {

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

              $this->recordModel->set('finvoice_type', 'PLL_DOMESTIC_INVOICE');

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

          /** {@inheritdoc} */

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

              'pobranie' => 'PLL_CASH_ON_DELIVERY',

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

                              case 1:

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

                      } catch (\Throwable $th) {

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

                          ++$e;

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

                      }

      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

                  ]]);

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

                  'issueTime' => 'cast (dbo.DOKUMENT_HANDLOWY.DATA_WYSTAWIENIA - 36163 as datetime)',

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

                          }

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

          protected function convertPaymentMethods(string $value, array $params): string

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

          {

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

              'ID_KONTRAHENTA' => ['fieldName' => 'accountid', 'fn' => 'findRelationship', 'tableName' => 'KONTRAHENT', 'skipMode' => true],

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

                  $pauser->setValue($lastId);

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

              if ($id = $this->findInMapTable($this->waproId, 'DOKUMENT_HANDLOWY')) {

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

           * @param array  $params

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

              }

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

              'przelew' => 'PLL_TRANSFER',

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

              foreach ($query->batch(100, $this->controller->getDb()) as $rows) {

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

                  $lastId = 0;

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

                      $this->skip = false;

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

                  return 0;

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

          /**

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

                  $fieldModel->setPicklistValues([$value]);

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

                  ->where(['ID_TYPU' => 1]);

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

                  $query->andWhere(['>', 'ID_DOKUMENTU_HANDLOWEGO', $val]);

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

              }

      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

              $this->recordModel->set($this->recordModel->getModule()->getSequenceNumberFieldName(), $this->row['NUMER']);

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

                  return $this->recordModel->getPreviousValue() ? 1 : 3;

      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

          const NAME = 'LBL_INVOICE';

      Line exceeds 120 characters; contains 157 characters
      Open

                  'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',

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

                  'saleDate' => 'cast (dbo.DOKUMENT_HANDLOWY.DATA_SPRZEDAZY - 36163 as datetime)',

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

                  'paymentDate' => 'cast (dbo.DOKUMENT_HANDLOWY.TERMIN_PLAT - 36163 as datetime)',

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

              if ($val = $pauser->getValue()) {

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

                                  ++$u;

      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

                  }

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

              if ($this->skip) {

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

              $value = explode(' ', $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

          }

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

          /**

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

                  $oldInventory = $this->recordModel->getInventoryData();

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

              if (isset($inventory[0]['name'])) {

      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

              'UWAGI' => 'description',

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

              $this->log("Create {$i} | Update {$u} | Skipped {$s} | Error {$e}");

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

           *

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

           * Convert date to system format.

      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

                  $this->recordModel->set('addresslevel5' . $key, $row['MIEJSCOWOSC']);

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

                  $this->recordModel->set('addresslevel7' . $key, $row['KOD_POCZTOWY']);

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

                          $same = true;

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

                          }

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

           * Get inventory items.

      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

              $currencyId = $this->getBaseCurrency()['currencyId'];

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

                      'comment1' => trim($row['OPIS']),

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

                      'unit' => $this->convertUnitName($row['JEDNOSTKA'], ['fieldName' => 'usageunit', 'moduleName' => 'Products']),

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

              $baseCurrency = $this->getBaseCurrency();

      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

                  $this->recordModel->set('company_name_' . $key, $row['FIRMA']);

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

          protected function getInventory(): array

      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

                      $productId = $this->addProduct($row['ID_ARTYKULU']);

      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

              $defaultCurrencyId = $baseCurrency['default']['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

           * @return void

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

                      $this->recordModel->set('last_name_' . $key, $lastName);

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

                                  $same = isset($oldItem[$name]) && $value == $oldItem[$name];

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

                              $inventory[$seq] = $oldItem;

      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' => $this->row['DOK_WAL'] ? $row['CENA_NETTO_WAL'] : $row['CENA_NETTO'],

      Line exceeds 120 characters; contains 126 characters
      Open

                      'unit' => $this->convertUnitName($row['JEDNOSTKA'], ['fieldName' => 'usageunit', 'moduleName' => 'Products']),

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

                          ]

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

                      'currencyparam' => $currencyParam,

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

                  ];

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

          protected function getCurrencyParam(int $currencyId): array

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

              $params = [

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

           */

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

              $row = (new \App\Db\Query())->select(['dbo.MIEJSCE_DOSTAWY.*'])->from('dbo.DOSTAWA')

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

                  ->one($this->controller->getDb());

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

                  $params = ['fieldName' => 'phone_' . $key];

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

          protected function loadInventory(): 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

                      'discountmode' => 1,

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

                          'additionalDiscount' => empty((float) $row['RABAT2']) ? 0 : (-$row['RABAT2']),

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

                      'taxparam' => \App\Json::encode(

      Line exceeds 120 characters; contains 127 characters
      Open

                  $date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));

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

                  ->where(['dbo.DOSTAWA.ID_DOKUMENTU_HANDLOWEGO' => $this->row['DOK_KOREKTY'] ? $this->row['ID_DOK_ORYGINALNEGO'] : $this->waproId])

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

                      foreach ($inventory as $seq => $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

                  $this->recordModel->set('subject', \App\Record::getLabel($inventory[0]['name'], true) ?: '-');

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

           */

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

              while ($row = $dataReader->read()) {

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

                          'individualDiscountType' => 'percentage',

      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 $inventory;

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

                  $this->recordModel->set('addresslevel1' . $key, $this->convertCountry($row['SYM_KRAJU']));

      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

              $inventory = $this->getInventory();

      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 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

          protected function addProduct(int $id): 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

          public function getCounter(): int

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

              return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());

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

           * Load delivery address.

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

          protected function loadDeliveryAddress(string $key): void

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

                  $this->recordModel->set($params['fieldName'], $phone);

      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

                          'aggregationType' => ['individual', 'additional'],

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

                              'aggregationType' => 'global',

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

           */

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

                      $info['value'] = round($this->row['PRZELICZNIK_WAL'], 5);

      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 ($same) {

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

          /**

      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

              } else {

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

           * @param array  $params

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

           * @param string $key

      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

                  $this->recordModel->set('addresslevel8' . $key, $row['ULICA_LOKAL']);

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

                  if ($row['ODBIORCA']) {

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

                      $this->recordModel->set('first_name_' . $key, $firstName);

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

                  }

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

                  $phone = $this->convertPhone($row['TEL'], $params);

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

                          foreach ($item as $name => $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 ($same && $oldItem) {

      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

              $this->recordModel->initInventoryData($inventory);

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

                  ->from('dbo.POZYCJA_DOKUMENTU_MAGAZYNOWEGO')

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

                  $productId = $this->findRelationship($row['ID_ARTYKULU'], ['tableName' => 'ARTYKUL']);

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

              if (!empty($this->row['DATA_KURS_WAL'])) {

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

                  }

      Line exceeds 120 characters; contains 145 characters
      Open

                      $value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);

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

                  $inventory[] = [

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

           * Add a product when it does not exist in CRM.

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

                      'name' => $productId,

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

                          $this->getGlobalTax($row['KOD_VAT']) ? [

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

                              'globalTax' => (float) $row['KOD_VAT'],

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

                      ),

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

                      'discount_aggreg' => 2,

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

                      $value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);

      Line exceeds 120 characters; contains 133 characters
      Open

              return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());

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

          /**

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

          /**

      Line exceeds 120 characters; contains 142 characters
      Open

                  ->where(['dbo.DOSTAWA.ID_DOKUMENTU_HANDLOWEGO' => $this->row['DOK_KOREKTY'] ? $this->row['ID_DOK_ORYGINALNEGO'] : $this->waproId])

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

              if ($row) {

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

              if (!$this->recordModel->isNew()) {

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

          }

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

                  $currencyId = $this->convertCurrency($this->row['SYM_WAL'], []);

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

                  ->createCommand($this->controller->getDb())->query();

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

              $inventory = [];

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

                          'individualDiscount' => empty((float) $row['RABAT']) ? 0 : (-$row['RABAT']),

      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

                      $info['conversion'] = empty($value) ? 1.0 : round(1 / $value, 5);

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

              return $params;

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

                      $info['value'] = empty($value) ? 1.0 : round($value, 5);

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

           *

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

                      $info['conversion'] = round(1 / $this->row['PRZELICZNIK_WAL'], 5);

      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 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

           * @param int $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

           * @param string $value

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

              return $value[0];

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

                              continue 2;

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

          {

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

              $currencyParam = \App\Json::encode($this->getCurrencyParam($currencyId));

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

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

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

                  $date = $this->convertDate($this->row['currencyDate'], []);

      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

                  $params[$currencyId] = $info;

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

              return $this->controller->getSynchronizer('Products')->importRecordById($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

              }

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

           * Load inventory items.

      Line exceeds 120 characters; contains 161 characters
      Open

              $dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO',  'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])

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

                              'aggregationType' => 'individual',

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

                  $date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));

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

          /**

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

          protected function convertDate(string $value, array $params): string

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

                      [$firstName, $lastName] = explode(' ', $row['ODBIORCA'], 2);

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

           *

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

                  foreach ($oldInventory as $oldSeq => $oldItem) {

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

                              unset($oldInventory[$oldSeq]);

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

              if (!empty($this->row['DOK_WAL'])) {

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

                  ->where(['ID_DOK_HANDLOWEGO' => $this->waproId])

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

                      'qty' => $row['ILOSC'],

      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

                  ->leftJoin('dbo.MIEJSCE_DOSTAWY', 'dbo.DOSTAWA.ID_MIEJSCA_DOSTAWY = dbo.MIEJSCE_DOSTAWY.ID_MIEJSCA_DOSTAWY')

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

                      'discountparam' => \App\Json::encode([

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

                              'individualTax' => (float) $row['KOD_VAT'],

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

                      'currency' => $currencyId,

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

           * Get currency param.

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

           * @param int $currencyId

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

                  $defaultCurrencyId => ['date' => $date, 'value' => 1.0, 'conversion' => 1.0],

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

              $info = ['date' => $date];

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

              if ($currencyId != $defaultCurrencyId) {

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

          /** {@inheritdoc} */

      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($this->row['PRZELICZNIK_WAL'])) {

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

          }

      There are no issues that match your filters.

      Category
      Status