YetiForceCompany/YetiForceCRM

View on GitHub
app/Fields/RecordNumber.php

Summary

Maintainability
C
1 day
Test Coverage
D
66%

Function updateRecords has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateRecords()
    {
        if ($this->isEmpty('id')) {
            return [];
        }
Severity: Minor
Found in app/Fields/RecordNumber.php - About 4 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

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

class RecordNumber extends \App\Base
{
    /**
     * Instance cache by module id.
     *
Severity: Minor
Found in app/Fields/RecordNumber.php by phpmd

Method updateRecords has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function updateRecords()
    {
        if ($this->isEmpty('id')) {
            return [];
        }
Severity: Major
Found in app/Fields/RecordNumber.php - About 2 hrs to fix

    File RecordNumber.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace App\Fields;
    
    /**
    Severity: Minor
    Found in app/Fields/RecordNumber.php - About 2 hrs to fix

      Function getRelatedValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getRelatedValue(bool $reload = false): string
          {
              if (!isset($this->relatedValue) || $reload) {
                  $value = [];
                  preg_match_all('/{{picklist:([a-zA-Z0-9_]+)}}|\$\((\w+) : ([,"\+\#\%\.\=\-\[\]\&\w\s\|\)\(\:]+)\)\$/u', $this->get('prefix') . $this->get('postfix'), $matches);
      Severity: Minor
      Found in app/Fields/RecordNumber.php - About 1 hr 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 updateRecords() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
      Open

          public function updateRecords()
          {
              if ($this->isEmpty('id')) {
                  return [];
              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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 getRelatedValue has a boolean flag argument $reload, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function getRelatedValue(bool $reload = false): string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

      Example

      class Foo {
          public function bar($flag = true) {
          }
      }

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

      Missing class import via use statement (line '250', column '40').
      Open

                          $oldSequences = $sequences = (new \App\Db\Query())->select(['value', 'cur_id'])->from('u_#__modentity_sequences')->where(['tabid' => $this->get('tabid')])->createCommand()->queryAllByGroup();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

              $sql = (new \App\Db\Query())->from('vtiger_modentity_num')->where(['tabid' => $this->get('tabid')])->createCommand()->getRawSql() . ' FOR UPDATE ';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

              $row = (new \App\Db\Query())->from('vtiger_modentity_num')->where(['tabid' => $tabId])->one() ?: [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

                      $sql = (new \App\Db\Query())->select(['cur_id'])->from('u_#__modentity_sequences')->where(['tabid' => $this->get('tabid'), 'value' => $value])->createCommand()->getRawSql() . ' FOR UPDATE ';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

                      $queryGenerator = new \App\QueryGenerator(\App\Module::getModuleName($this->get('tabid')));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

              return self::$sequenceNumberFieldCache[$tabId] = (new \App\Db\Query())->select(['fieldname', 'columnname', 'tablename'])->from('vtiger_field')
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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

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

                          } else {
                              $value[] = \App\TextParser::getInstanceByModel($this->getRecord())->setGlobalPermissions(false)->setContent($element)->parse()->getContent();
                          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

                              } else {
                                  $seq = $sequenceNumber++;
                              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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\Purifier' in method 'getIncrementNumber'.
      Open

              return \App\Purifier::decodeHtml($fullPrefix);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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_Module_Model' in method 'updateRecords'.
      Open

              $moduleModel = \Vtiger_Module_Model::getInstance($this->get('tabid'));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

              } else {
                  $data['cur_id'] = $reqNo;
                  $this->set('cur_id', $reqNo);
              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

              } else {
                  $currentSequenceNumber = $this->get('cur_id');
                  if ($value) {
                      $sql = (new \App\Db\Query())->select(['cur_id'])->from('u_#__modentity_sequences')->where(['tabid' => $this->get('tabid'), 'value' => $value])->createCommand()->getRawSql() . ' FOR UPDATE ';
                      $currentSequenceNumber = \App\Db::getInstance()->createCommand($sql)->queryScalar() ?: 1;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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\TextParser' in method 'updateRecords'.
      Open

                      if (\App\TextParser::isVaribleToParse($this->get('prefix') . $this->get('postfix'))) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

          public function setNumberSequence(int $reqNo, string $actualSequence)
          {
              $dbCommand = \App\Db::getInstance()->createCommand();
              $data = ['cur_sequence' => $actualSequence];
              $this->set('cur_sequence', $actualSequence);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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 '\App\Module' in method 'updateRecords'.
      Open

                      $queryGenerator = new \App\QueryGenerator(\App\Module::getModuleName($this->get('tabid')));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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\Module' in method 'getInstance'.
      Open

                  $tabId = \App\Module::getModuleId($tabId);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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\Log' in method 'updateRecords'.
      Open

                      \App\Log::error('Updating Missing Sequence Number FAILED! REASON: Field table and module table mismatching.');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

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

                  } else {
                      \App\Log::error('Updating Missing Sequence Number FAILED! REASON: Field table and module table mismatching.');
                  }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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\Fields\Picklist' in method 'getPicklistValue'.
      Open

              $values = Picklist::getValues($picklistName);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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\Purifier' in method 'updateRecords'.
      Open

                              $dbCommand->update($fieldTable, [$fieldColumn => \App\Purifier::decodeHtml($this->parseNumber($seq))], [$moduleModel->getEntityInstance()->table_index => $recordInfo['id']])
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      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

      syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
      Open

          private static array $instanceCache = [];
      Severity: Critical
      Found in app/Fields/RecordNumber.php by phan

      Avoid excessively long variable names like $currentSequenceNumber. Keep variable name length under 20.
      Open

                  $currentSequenceNumber = 1;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

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

      Avoid excessively long variable names like $sequenceNumberFieldCache. Keep variable name length under 20.
      Open

          private static array $sequenceNumberFieldCache = [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpmd

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

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

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return void
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Updates missing numbers of records.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $oldNumber = $sequenceNumber;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              $dbCommand->update('vtiger_modentity_num', ['cur_id' => $sequenceNumber], ['tabid' => $this->get('tabid')])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function updateModuleVariablesSequences($currentId, $conditions = []): void
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $conditions['tabid'] = $this->get('tabid');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $fieldTable = $fieldModel->getTableName();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              $dbCommand->update($fieldTable, [$fieldColumn => \App\Purifier::decodeHtml($this->parseNumber($seq))], [$moduleModel->getEntityInstance()->table_index => $recordInfo['id']])
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return false|string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($fieldModel) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $queryGenerator->setFields(array_keys($queryGenerator->getModuleFields()))->setField('id');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          while ($recordInfo = $dataReader->read()) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  } else {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $dbCommand->upsert('u_#__modentity_sequences', ['tabid' => $this->get('tabid'),    'value' => $value,    'cur_id' => $reqNo], ['cur_id' => $reqNo])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function isNewSequence(): bool
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if ($fieldTable === $moduleModel->getEntityInstance()->table_name) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $sequenceNumber = $this->get('cur_id');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $moduleModel = \Vtiger_Module_Model::getInstance($this->get('tabid'));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              if ($value && isset($sequences[$value])) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          if ($oldNumber != $sequenceNumber) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              $dbCommand->update('u_#__modentity_sequences', ['cur_id' => $num], ['value' => $prefix, 'tabid' => $this->get('tabid')])
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $queryGenerator->permissions = false;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $returninfo;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      if ($totalCount) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Date function that can be overrided in tests.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this->getRecord()->isNew()
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @throws \yii\db\Exception
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $fieldModel = current($moduleModel->getFieldsByUiType(4));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              $seq = 0;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                                  $sequences[$value] = 1;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                                  ->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param int|null $time
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              } else {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return array
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $returninfo = [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $dataReader = $queryGenerator->createQuery()->createCommand()->query();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $oldSequences = $sequences = (new \App\Db\Query())->select(['value', 'cur_id'])->from('u_#__modentity_sequences')->where(['tabid' => $this->get('tabid')])->createCommand()->queryAllByGroup();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              ++$returninfo['updatedrecords'];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string   $format
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return bool
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              $this->setRecord($moduleModel->getRecordFromArray($recordInfo));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param int   $currentId
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $fieldColumn = $fieldModel->getColumnName();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $queryGenerator = new \App\QueryGenerator(\App\Module::getModuleName($this->get('tabid')));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $queryGenerator->setFields([$picklistName, $fieldModel->getName(), 'id']);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $queryGenerator->addNativeCondition(['or', [$fieldColumn => ''], [$fieldColumn => null]]);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $returninfo['updatedrecords'] = 0;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $dataReader->close();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      \App\Log::error('Updating Missing Sequence Number FAILED! REASON: Field table and module table mismatching.');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $dbCommand->update('vtiger_modentity_num', $data, ['tabid' => $this->get('tabid')])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  || ($this->getRelatedValue() && $this->getRelatedValue() !== (clone $this)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function updateRecords()
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      if (\App\TextParser::isVaribleToParse($this->get('prefix') . $this->get('postfix'))) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                                  $seq = $sequences[$value]++;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $dbCommand->upsert('u_#__modentity_sequences', ['tabid' => $this->get('tabid'),    'value' => $value,    'cur_id' => $reqNo], ['cur_id' => $reqNo])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          foreach (array_diff($sequences, $oldSequences) as $prefix => $num) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                                  ->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($this->isEmpty('id')) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  return [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $picklistName = $this->getPicklistName();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                                  $seq = $sequenceNumber++;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Function to check if record need a new number of sequence.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                                  $seq = $sequences[$value]++;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              } else {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public static function date($format, $time = null)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $currentSeqId = static::date('Y');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public static function getSequenceNumberFieldName(int $tabId)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return self::$sequenceNumberFieldCache[$tabId] = (new \App\Db\Query())->select(['fieldname', 'columnname', 'tablename'])->from('vtiger_field')
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($tabId) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      ->setRecord((clone $this->getRecord())->getInstanceByEntity($this->getRecord()->getEntity(), $this->getRecord()->getId()))->getRelatedValue(true));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              } elseif ($value) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $time = time();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return int
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  return $dbCommand->insert('vtiger_modentity_num', [
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  unset(self::$sequenceNumberFieldCache[$tabId]);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (null === $recordValue) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return '';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->set('cur_id', $reqNo);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Update module variables sequences.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              \App\Db::getInstance()->createCommand()->update('u_#__modentity_sequences', ['cur_id' => $currentId], $conditions)->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $returninfo['totalrecords'] = $totalCount;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              $value = $this->getRelatedValue(true);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Saves configuration.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'postfix' => $this->get('postfix') ?: '',
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param int $tabId
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Get sequence number that should be saved.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              switch ($resetSequence) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  case 'Y':
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  ->where(['tabid' => $tabId, 'uitype' => 4, 'presence' => [0, 2]])->one();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $currentSeqId = '';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'prefix' => $this->get('prefix'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $dbCommand->update(
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  ['tabid' => $this->get('tabid')]
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              )
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Get sequence number field name.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (isset(self::$sequenceNumberFieldCache[$tabId])) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'cur_sequence' => $this->get('cur_sequence'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'prefix' => $this->get('prefix'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (null === $time) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      break;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $currentSeqId = static::date('Ymd'); // same as above because 2016-10-03 (03) === 2016-11-03 (03)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $currentSeqId;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($this->isEmpty('id')) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'tabid' => $this->get('tabid'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  ])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $data['cur_id'] = $reqNo;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param array $conditions
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $totalCount = $dataReader->count();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $currentSeqId = static::date('Ym'); // with year because 2016-10 (10) === 2017-10 (10) and number will be incremented but should be set to 1 (new year)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  case 'D':
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function save()
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'leading_zeros' => $this->get('leading_zeros'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param int $tabId
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  return self::$sequenceNumberFieldCache[$tabId];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return void
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              self::$sequenceNumberFieldCache = null;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string|bool
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Get sequence number field.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          private function getPicklistName(): string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $matches[1] ?? '';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Returns prefix of picklist.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string      $picklistName
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return date($format, $time);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'reset_sequence' => $this->get('reset_sequence'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public static function getSequenceNumberField(int $tabId)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          private function getPicklistValue(string $picklistName, ?string $recordValue = null): string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              foreach ($values as $value) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if ($recordValue === $value[$picklistName]) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Returns name of picklist. Postfix or prefix can contains name of picklist.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string $resetSequence one character
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public static function getSequenceNumber($resetSequence): string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      break;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @throws \yii\db\Exception
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'cur_sequence' => $this->get('cur_sequence'), ],
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              preg_match('/{{picklist:([a-z0-9_]+)}}/i', $this->get('prefix') . $this->get('postfix'), $matches);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param string|null $recordValue
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'reset_sequence' => $this->get('reset_sequence'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  [
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          public static function cleanSequenceNumberFieldCache(?int $tabId)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      break;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  default:
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'cur_id' => $this->get('cur_id'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              return self::getSequenceNumberField($tabId)['fieldname'] ?? '';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @param int|null $tabId
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $recordValue = $this->getRecord()->get($picklistName);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      return $value['prefix'] ?? '';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'leading_zeros' => $this->get('leading_zeros') ?: 0,
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'start_id' => $this->get('cur_id'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'cur_id' => $this->get('cur_id'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'postfix' => $this->get('postfix'),
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return string[]|bool
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Clean sequence number field cache.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              $values = Picklist::getValues($picklistName);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  case 'M':
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'vtiger_modentity_num',
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

                  ->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Spaces must be used for alignment; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Instance cache by module id.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $this->getNumDataForUpdate();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $instance = new static();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $actualSequence = static::getSequenceNumber($this->get('reset_sequence'));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $value = [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                              $value[] = $this->getPicklistValue($matches[1][$key]);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 165 characters
      Open

                              $value[] = \App\TextParser::getInstanceByModel($this->getRecord())->setGlobalPermissions(false)->setContent($element)->parse()->getContent();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Sequence number field cache by module id.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              if (!is_numeric($tabId)) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public function getNumDataForUpdate()
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $sql = (new \App\Db\Query())->from('vtiger_modentity_num')->where(['tabid' => $this->get('tabid')])->createCommand()->getRawSql() . ' FOR UPDATE ';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              return $this->setData(array_merge($this->getData(), $row));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              if ($this->get('reset_sequence') && $this->get('cur_sequence') !== $actualSequence) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  if ($value) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              return $this->relatedValue;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $row['tabid'] = $tabId;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $instance->setData($row);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @param \Vtiger_Record_Model $recordModel
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public function setRecord(\Vtiger_Record_Model $recordModel): self
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @return \Vtiger_Record_Model|null
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public function getRecord(): ?\Vtiger_Record_Model
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $this->setNumberSequence($reqNo, $actualSequence);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $fullPrefix = $this->parseNumber($currentSequenceNumber);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public function getRelatedValue(bool $reload = false): string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  preg_match_all('/{{picklist:([a-zA-Z0-9_]+)}}|\$\((\w+) : ([,"\+\#\%\.\=\-\[\]\&\w\s\|\)\(\:]+)\)\$/u', $this->get('prefix') . $this->get('postfix'), $matches);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @var \App\Fields\RecordNumber[]
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $tabId = \App\Module::getModuleId($tabId);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              if (isset(static::$instanceCache[$tabId])) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  return static::$instanceCache[$tabId];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $currentSequenceNumber = $this->get('cur_id');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              if (!isset($this->relatedValue) || $reload) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                      foreach ($matches[0] as $key => $element) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Related value.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @var string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              return static::$instanceCache[$tabId] = $instance;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Returns model of record.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              return $this->get('recordModel');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $row = (new \App\Db\Query())->from('vtiger_modentity_num')->where(['tabid' => $tabId])->one() ?: [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $currentSequenceNumber = 1;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $this->updateModuleVariablesSequences($currentSequenceNumber);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $reqNo = $currentSequenceNumber + 1;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          private $relatedValue;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @return $this
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $row['tabid'] = $this->get('tabid');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Gets related value.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  if ($this->getRecord() && !empty($matches[0])) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Function to get instance.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @return \App\Fields\RecordNumber
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @return string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $this->relatedValue = implode('|', $value);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              return preg_replace_callback('/{{picklist:([a-z0-9_]+)}}/i', fn ($matches) => $this->getRecord() ? $this->getPicklistValue($matches[1]) : $matches[1], $string);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Sets model of record.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 206 characters
      Open

                      $sql = (new \App\Db\Query())->select(['cur_id'])->from('u_#__modentity_sequences')->where(['tabid' => $this->get('tabid'), 'value' => $value])->createCommand()->getRawSql() . ' FOR UPDATE ';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @return string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 168 characters
      Open

              return preg_replace_callback('/{{picklist:([a-z0-9_]+)}}/i', fn ($matches) => $this->getRecord() ? $this->getPicklistValue($matches[1]) : $matches[1], $string);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public function setNumberSequence(int $reqNo, string $actualSequence)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $data = ['cur_sequence' => $actualSequence];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          private static array $instanceCache = [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 155 characters
      Open

              $sql = (new \App\Db\Query())->from('vtiger_modentity_num')->where(['tabid' => $this->get('tabid')])->createCommand()->getRawSql() . ' FOR UPDATE ';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $value = $this->getRelatedValue();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                      $currentSequenceNumber = \App\Db::getInstance()->createCommand($sql)->queryScalar() ?: 1;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @return string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 172 characters
      Open

                  preg_match_all('/{{picklist:([a-zA-Z0-9_]+)}}|\$\((\w+) : ([,"\+\#\%\.\=\-\[\]\&\w\s\|\)\(\:]+)\)\$/u', $this->get('prefix') . $this->get('postfix'), $matches);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                          } else {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $string = str_replace(['{{YYYY}}', '{{YY}}', '{{MM}}', '{{M}}', '{{DD}}', '{{D}}'], [static::date('Y'), static::date('y'), static::date('m'), static::date('n'), static::date('d'), static::date('j')], $this->get('prefix') . str_pad((string) $seq, $this->get('leading_zeros'), '0', STR_PAD_LEFT) . $this->get('postfix'));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @param int    $reqNo
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $row = \App\Db::getInstance()->createCommand($sql)->queryOne();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @return $this
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @param int|string $tabId
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $this->set('recordModel', $recordModel);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              return $this;
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              return \App\Purifier::decodeHtml($fullPrefix);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @param bool $reload
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                      }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @param int $seq
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                      $sql = (new \App\Db\Query())->select(['cur_id'])->from('u_#__modentity_sequences')->where(['tabid' => $this->get('tabid'), 'value' => $value])->createCommand()->getRawSql() . ' FOR UPDATE ';
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                          if (0 === strpos($element, '{{picklist:')) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                              $value[] = \App\TextParser::getInstanceByModel($this->getRecord())->setGlobalPermissions(false)->setContent($element)->parse()->getContent();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              if ($this->getRecord()) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 151 characters
      Open

                  $string = \App\TextParser::getInstanceByModel($this->getRecord())->setGlobalPermissions(false)->setContent($string)->parse()->getContent();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Sets number of sequence.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 144 characters
      Open

                              $dbCommand->update('u_#__modentity_sequences', ['cur_id' => $num], ['value' => $prefix, 'tabid' => $this->get('tabid')])
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @var array
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          private static array $sequenceNumberFieldCache = [];
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public static function getInstance($tabId): self
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Get data for update.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public function getIncrementNumber(): string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              } else {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 126 characters
      Open

                      \App\Log::error('Updating Missing Sequence Number FAILED! REASON: Field table and module table mismatching.');
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Function to get the next nuber of record.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          public function parseNumber(int $seq): string
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              if ($value = $this->getRelatedValue()) {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 211 characters
      Open

                          $oldSequences = $sequences = (new \App\Db\Query())->select(['value', 'cur_id'])->from('u_#__modentity_sequences')->where(['tabid' => $this->get('tabid')])->createCommand()->queryAllByGroup();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @throws \yii\db\Exception
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 134 characters
      Open

              \App\Db::getInstance()->createCommand()->update('u_#__modentity_sequences', ['cur_id' => $currentId], $conditions)->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * @param string $actualSequence
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 143 characters
      Open

                              $dbCommand->update('vtiger_modentity_num', ['cur_id' => $sequenceNumber], ['tabid' => $this->get('tabid')])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $string = \App\TextParser::getInstanceByModel($this->getRecord())->setGlobalPermissions(false)->setContent($string)->parse()->getContent();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

                  $dbCommand->upsert('u_#__modentity_sequences', ['tabid' => $this->get('tabid'),    'value' => $value,    'cur_id' => $reqNo], ['cur_id' => $reqNo])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 197 characters
      Open

                              $dbCommand->update($fieldTable, [$fieldColumn => \App\Purifier::decodeHtml($this->parseNumber($seq))], [$moduleModel->getEntityInstance()->table_index => $recordInfo['id']])
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

           * Parse number based on postfix and prefix.
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              $this->set('cur_sequence', $actualSequence);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 163 characters
      Open

                      ->setRecord((clone $this->getRecord())->getInstanceByEntity($this->getRecord()->getEntity(), $this->getRecord()->getId()))->getRelatedValue(true));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 167 characters
      Open

                      $currentSeqId = static::date('Ym'); // with year because 2016-10 (10) === 2017-10 (10) and number will be incremented but should be set to 1 (new year)
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 327 characters
      Open

              $string = str_replace(['{{YYYY}}', '{{YY}}', '{{MM}}', '{{M}}', '{{DD}}', '{{D}}'], [static::date('Y'), static::date('y'), static::date('m'), static::date('n'), static::date('d'), static::date('j')], $this->get('prefix') . str_pad((string) $seq, $this->get('leading_zeros'), '0', STR_PAD_LEFT) . $this->get('postfix'));
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 166 characters
      Open

                  $dbCommand->upsert('u_#__modentity_sequences', ['tabid' => $this->get('tabid'),    'value' => $value,    'cur_id' => $reqNo], ['cur_id' => $reqNo])->execute();
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Line exceeds 120 characters; contains 150 characters
      Open

              return self::$sequenceNumberFieldCache[$tabId] = (new \App\Db\Query())->select(['fieldname', 'columnname', 'tablename'])->from('vtiger_field')
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      Space before opening parenthesis of function call prohibited
      Open

              return preg_replace_callback('/{{picklist:([a-z0-9_]+)}}/i', fn ($matches) => $this->getRecord() ? $this->getPicklistValue($matches[1]) : $matches[1], $string);
      Severity: Minor
      Found in app/Fields/RecordNumber.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status