YetiForceCompany/YetiForceCRM

View on GitHub
app/Condition.php

Summary

Maintainability
D
2 days
Test Coverage
F
56%

Function validSearchParams has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
    {
        $searchParamsCount = \count($searchParams);
        if ($searchParamsCount > 2) {
            throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
Severity: Minor
Found in app/Condition.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 Condition has an overall complexity of 58 which is very high. The configured complexity threshold is 50.
Open

class Condition
{
    /**
     * @var array Data filter list.
     */
Severity: Minor
Found in app/Condition.php by phpmd

File Condition.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Condition main class.
 *
Severity: Minor
Found in app/Condition.php - About 3 hrs to fix

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

        public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
        {
            if (isset($conditions['rules'])) {
                foreach ($conditions['rules'] as $key => &$condition) {
                    if (isset($condition['condition'])) {
    Severity: Minor
    Found in app/Condition.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        private static function parseConditions(?array $conditions, \Vtiger_Record_Model $recordModel): bool
        {
            if (empty($conditions) || empty($conditions['rules'])) {
                return true;
            }
    Severity: Minor
    Found in app/Condition.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

    Method validSearchParams has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
        {
            $searchParamsCount = \count($searchParams);
            if ($searchParamsCount > 2) {
                throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
    Severity: Minor
    Found in app/Condition.php - About 1 hr to fix

      Function getFieldsFromConditions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getFieldsFromConditions(array $conditions): array
          {
              $fields = ['baseModule' => [], 'referenceModule' => []];
              if (isset($conditions['rules'])) {
                  foreach ($conditions['rules'] as &$condition) {
      Severity: Minor
      Found in app/Condition.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

      Function getConditionsFromRequest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getConditionsFromRequest(array $conditions): array
          {
              if (isset($conditions['rules'])) {
                  foreach ($conditions['rules'] as &$condition) {
                      if (isset($condition['condition'])) {
      Severity: Minor
      Found in app/Condition.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

      Method checkCondition has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function checkCondition(array $rule, \Vtiger_Record_Model $recordModel): bool
          {
              [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $rule['fieldname']), 3, false);
              if ($sourceFieldName) {
                  if ($recordModel->isEmpty($sourceFieldName)) {
      Severity: Minor
      Found in app/Condition.php - About 1 hr to fix

        Function checkCondition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function checkCondition(array $rule, \Vtiger_Record_Model $recordModel): bool
            {
                [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $rule['fieldname']), 3, false);
                if ($sourceFieldName) {
                    if ($recordModel->isEmpty($sourceFieldName)) {
        Severity: Minor
        Found in app/Condition.php - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
            {
                if (isset($conditions['rules'])) {
                    foreach ($conditions['rules'] as $key => &$condition) {
                        if (isset($condition['condition'])) {
        Severity: Minor
        Found in app/Condition.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 validSearchParams() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
        Open

            public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
            {
                $searchParamsCount = \count($searchParams);
                if ($searchParamsCount > 2) {
                    throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
        Severity: Minor
        Found in app/Condition.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

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

            public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
        Severity: Critical
        Found in app/Condition.php by sonar-php

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

        See

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

            public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
        Severity: Critical
        Found in app/Condition.php by sonar-php

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

        See

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

                    throw new \App\Exceptions\AppException("ERR_NOT_FOUND_QUERY_FIELD_CONDITION|$fieldName|$className");
        Severity: Minor
        Found in app/Condition.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 '320', column '14').
        Open

                    throw new \App\Exceptions\AppException('ERR_NOT_FOUND_FIELD_MODEL|' . $fieldName);
        Severity: Minor
        Found in app/Condition.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 '411', column '16').
        Open

                            throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $v, 406);
        Severity: Minor
        Found in app/Condition.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 validSearchParams has a boolean flag argument $convert, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
        Severity: Minor
        Found in app/Condition.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

        Avoid using static access to class 'App\Utils' in method 'validSearchParams'.
        Open

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.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 'checkCondition'.
        Open

                    Log::error("Not found field model | Field name: $fieldName | Module: $moduleName", 'Condition');
        Severity: Minor
        Found in app/Condition.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 '389', column '14').
        Open

            public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
            {
                if (isset($conditions['rules'])) {
                    foreach ($conditions['rules'] as $key => &$condition) {
                        if (isset($condition['condition'])) {
        Severity: Minor
        Found in app/Condition.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\Utils' in method 'validSearchParams'.
        Open

                    throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
        Severity: Minor
        Found in app/Condition.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\Utils' in method 'validSearchParams'.
        Open

                            throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$count}|| <> 3 or 4||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.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 checkCondition uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $recordField = new $className($recordModel, $fieldModel, $rule);
                }
        Severity: Minor
        Found in app/Condition.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 getFieldsFromConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                        } else {
                            [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $condition['fieldname']), 3, false);
                            if ($sourceFieldName) {
                                $fields['referenceModule'][$moduleName][$sourceFieldName] = $fieldName;
                            } else {
        Severity: Minor
        Found in app/Condition.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 getFieldsFromConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                            } else {
                                $fields['baseModule'][] = $fieldName;
                            }
        Severity: Minor
        Found in app/Condition.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 getConditionsFromRequest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                        } else {
                            $operator = $condition['operator'];
                            $value = $condition['value'] ?? '';
                            if (!\in_array($operator, array_merge(self::OPERATORS_WITHOUT_VALUES, self::FIELD_COMPARISON_OPERATORS, array_keys(self::DATE_OPERATORS)))) {
                                [$fieldName, $fieldModuleName,] = array_pad(explode(':', $condition['fieldname']), 3, false);
        Severity: Minor
        Found in app/Condition.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 validSearchParams uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                        } else {
                            if (!isset($fields[$param[0]])) {
                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
                            }
                            $value = $fields[$param[0]]->getUITypeModel()->getDbConditionBuilderValue($param[2], $param[1]);
        Severity: Minor
        Found in app/Condition.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 parseConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                    } else {
                        $ruleResult = self::checkCondition($rule, $recordModel);
                    }
        Severity: Minor
        Found in app/Condition.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\Utils' in method 'validSearchParams'.
        Open

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.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 'checkCondition'.
        Open

                    Log::error("Not found record field condition | Field name: $fieldName | Module: $moduleName | FieldDataType: " . ucfirst($fieldModel->getFieldDataType()), 'Condition');
        Severity: Minor
        Found in app/Condition.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 removeFieldFromCondition uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                        } else {
                            [$cFieldName, $cModuleName, $sourceFieldName] = array_pad(explode(':', $condition['fieldname']), 3, false);
                            if (($fieldName === $cFieldName && $moduleName === $cModuleName) || ($sourceFieldName && $sourceFieldName === $fieldName && $moduleName === $baseModuleName)) {
                                $condition = [];
                            }
        Severity: Minor
        Found in app/Condition.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 '\Vtiger_Record_Model' in method 'checkCondition'.
        Open

                    $sourceRecordModel = self::$recordCache[$recordModel->get($sourceFieldName)] ?? \Vtiger_Record_Model::getInstanceById($recordModel->get($sourceFieldName));
        Severity: Minor
        Found in app/Condition.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\Validator' in method 'validAdvancedConditions'.
        Open

                        if (!\App\Validator::integer($v)) {
        Severity: Minor
        Found in app/Condition.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

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

                                [$fieldName, $fieldModuleName,] = array_pad(explode(':', $condition['fieldname']), 3, false);
        Severity: Critical
        Found in app/Condition.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

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

        Exceptions

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

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

                if (!empty($advancedConditions['relationConditions']) && 0 != $advancedConditions['relationId']) {
        Severity: Critical
        Found in app/Condition.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

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

        Exceptions

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

        Define a constant instead of duplicating this literal "rules" 11 times.
        Open

                if (isset($conditions['rules'])) {
        Severity: Critical
        Found in app/Condition.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

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

        Exceptions

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

        Define a constant instead of duplicating this literal "condition" 5 times.
        Open

                        if (isset($condition['condition'])) {
        Severity: Critical
        Found in app/Condition.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

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

        Exceptions

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

        Define a constant instead of duplicating this literal "label" 33 times.
        Open

                'custom' => ['label' => 'LBL_CUSTOM'],
        Severity: Critical
        Found in app/Condition.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

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

        Exceptions

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

        Call to method integer from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
        Open

                        if (!\App\Validator::integer($v)) {
        Severity: Critical
        Found in app/Condition.php by phan

        Call to method getField from undeclared class \App\Vtiger_Record_Model
        Open

                    $fieldModel = $sourceRecordModel->getField($fieldName);
        Severity: Critical
        Found in app/Condition.php by phan

        Property \App\Condition::$recordCache has undeclared type \App\Vtiger_Record_Model[]
        Open

            private static $recordCache = [];
        Severity: Minor
        Found in app/Condition.php by phan

        Call with 2 arg(s) to \App\Utils::varExport() which only takes 1 arg(s) defined at /code/app/Utils.php:38
        Open

                    throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
        Severity: Info
        Found in app/Condition.php by phan

        Call with 2 arg(s) to \App\Utils::varExport() which only takes 1 arg(s) defined at /code/app/Utils.php:38
        Open

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Info
        Found in app/Condition.php by phan

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

                    Log::error("Not found record field condition | Field name: $fieldName | Module: $moduleName | FieldDataType: " . ucfirst($fieldModel->getFieldDataType()), 'Condition');
        Severity: Critical
        Found in app/Condition.php by phan

        Call with 2 arg(s) to \App\Utils::varExport() which only takes 1 arg(s) defined at /code/app/Utils.php:38
        Open

                            throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$count}|| <> 3 or 4||" . Utils::varExport($param, true), 406);
        Severity: Info
        Found in app/Condition.php by phan

        Call with 2 arg(s) to \App\Utils::varExport() which only takes 1 arg(s) defined at /code/app/Utils.php:38
        Open

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Info
        Found in app/Condition.php by phan

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

                    Log::error("Not found field model | Field name: $fieldName | Module: $moduleName", 'Condition');
        Severity: Critical
        Found in app/Condition.php by phan

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

                    array_map(function ($v) {
        Severity: Minor
        Found in app/Condition.php by phpmd

        ShortVariable

        Since: 0.2

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

        Example

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

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

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

                'prevfy' => ['label' => 'LBL_PREVIOUS_FY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'greaterthannow' => ['label' => 'LBL_GREATER_THAN_NOW'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            const DATE_OPERATORS = [
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @var array Data filter list.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'smallerthannow' => ['label' => 'LBL_SMALLER_THAN_NOW'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'custom' => ['label' => 'LBL_CUSTOM'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nextworkingday' => ['label' => 'LBL_NEXT_WORKING_DAY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'b' => 'LBL_BEFORE',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nom' => 'LBL_USER_CURRENTLY_NOT_LOGGED',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'wr' => 'LBL_IS_WATCHING_RECORD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'prevfq',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last15days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 160 characters
        Open

                    throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            if (!isset($fields[$referenceField], $relatedFields[$relatedFieldName])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'yesterday' => ['label' => 'LBL_YESTERDAY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'untiltoday' => ['label' => 'LBL_UNTIL_TODAY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'lastweek' => ['label' => 'LBL_LAST_WEEK'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next60days' => ['label' => 'LBL_NEXT_60_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            const FIELD_COMPARISON_OPERATORS = ['ef', 'nf', 'lf', 'gf', 'mf', 'hf'];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            ];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @var string[] Operators without values.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thisfq',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last90days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last120days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                if ($searchParamsCount > 2) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nwr' => 'LBL_IS_NOT_WATCHING_RECORD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'gf' => 'LBL_GREATER_THAN_FIELD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'nextweek',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thismonth',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @param array  $searchParams
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 155 characters
        Open

                            throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$count}|| <> 3 or 4||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thisfy' => ['label' => 'LBL_CURRENT_FY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nextfq' => ['label' => 'LBL_NEXT_FQ'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'previousworkingday' => ['label' => 'LBL_PREVIOUS_WORKING_DAY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last7days' => ['label' => 'LBL_LAST_7_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next90days' => ['label' => 'LBL_NEXT_90_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'ny' => 'LBL_IS_NOT_EMPTY',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thisfy',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'lastweek',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nextmonth',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last60days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'prevfq' => ['label' => 'LBL_PREVIOUS_FQ'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'e' => 'LBL_EQUALS',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'kh' => 'LBL_DOES_NOT_CONTAIN_HIERARCHY',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'a' => 'LBL_AFTER',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'hf' => 'LBL_GREATER_OR_EQUAL_FIELD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'greaterthannow',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next90days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            ];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    foreach ($params as $param) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            $relatedFields = \Vtiger_Module_Model::getInstance($relatedModule)->getFields();
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thisfq' => ['label' => 'LBL_CURRENT_FQ'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                's' => 'LBL_STARTS_WITH',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'ef' => 'LBL_EQUALS_FIELD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next15days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'previousworkingday',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                        [$relatedFieldName, $relatedModule, $referenceField] = array_pad(explode(':', $param[0]), 3, null);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'tomorrow' => ['label' => 'LBL_TOMORROW'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'k' => 'LBL_DOES_NOT_CONTAIN',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'g' => 'LBL_GREATER_THAN',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'bw' => 'LBL_BETWEEN',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'ogu' => 'LBL_USERS_GROUP_LOGGED_IN_USER',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thisweek',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'nextfy' => ['label' => 'LBL_NEXT_FY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'moreThanDaysAgo' => ['label' => 'LBL_DATE_CONDITION_MORE_THAN_DAYS_AGO'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @var string[] Supported advanced filter operations.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'h' => 'LBL_GREATER_OR_EQUAL',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'mf' => 'LBL_LESS_THAN_OR_EQUAL_FIELD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last60days' => ['label' => 'LBL_LAST_60_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$count}|| <> 3 or 4||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last120days' => ['label' => 'LBL_LAST_120_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next30days' => ['label' => 'LBL_NEXT_30_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'n' => 'LBL_NOT_EQUAL_TO',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'ch' => 'LBL_CONTAINS_HIERARCHY',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'lf' => 'LBL_LESS_THAN_FIELD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last7days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

                'ro' => 'LBL_IS_RECORD_OPEN',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            const OPERATORS_WITHOUT_VALUES = [
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last30days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                        $count = \count($param);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        if ($relatedModule) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'l' => 'LBL_LESS_THAN',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'y' => 'LBL_IS_EMPTY',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'om' => 'LBL_CURRENTLY_LOGGED_USER',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'ogr' => 'LBL_CURRENTLY_LOGGED_USER_GROUP',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'hs' => 'LBL_HAS_CHANGED',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'hst' => 'LBL_HAS_CHANGED_TO',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'today',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'lastmonth',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next30days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next120days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @param string $moduleName
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                $result = [];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    $tempParam = [];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        if (3 !== $count && 4 !== $count) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'lastmonth' => ['label' => 'LBL_LAST_MONTH'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nextmonth' => ['label' => 'LBL_NEXT_MONTH'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last30days' => ['label' => 'LBL_LAST_30_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'last90days' => ['label' => 'LBL_LAST_90_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'prevfy',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next60days',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @var Vtiger_Record_Model[]
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                $searchParamsCount = \count($searchParams);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'today' => ['label' => 'LBL_TODAY'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thismonth' => ['label' => 'LBL_CURRENT_MONTH'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next15days' => ['label' => 'LBL_NEXT_15_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            ];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

            const STANDARD_OPERATORS = [
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'tomorrow',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * Vtiger_Record_Model instance cache.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        if (empty($param)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            continue;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'c' => 'LBL_CONTAINS',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'smallerthannow',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nextfy',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'untiltoday',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            private static $recordCache = [];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @param bool   $convert
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'last15days' => ['label' => 'LBL_LAST_15_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'next120days' => ['label' => 'LBL_NEXT_120_DAYS'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @var string[] List of field comparison operators
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'ew' => 'LBL_ENDS_WITH',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @throws \App\Exceptions\IllegalValue
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                $fields = \Vtiger_Module_Model::getInstance($moduleName)->getFields();
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

                return $conditions;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                return self::parseConditions($conditions, $recordModel);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                if (empty($conditions) || empty($conditions['rules'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                $result = false;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    $result = $ruleResult;
        Severity: Minor
        Found in app/Condition.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/Condition.php by phpcodesniffer

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

                    if ($recordModel->isEmpty($sourceFieldName)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 167 characters
        Open

                    $sourceRecordModel = self::$recordCache[$recordModel->get($sourceFieldName)] ?? \Vtiger_Record_Model::getInstanceById($recordModel->get($sourceFieldName));
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    $fieldModel = $recordModel->getField($fieldName);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'thisweek' => ['label' => 'LBL_CURRENT_WEEK'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nextweek' => ['label' => 'LBL_NEXT_WEEK'],
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                'm' => 'LBL_LESS_THAN_OR_EQUAL',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'rc' => 'LBL_IS_RECORD_CLOSED',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nco' => 'LBL_NOT_CREATED_BY_OWNER',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nf' => 'LBL_NOT_EQUAL_TO_FIELD',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'y', 'ny', 'om', 'nom', 'ogr', 'wr', 'nwr', 'hs', 'ro', 'rc', 'nco', 'ogu',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'yesterday',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                'nextworkingday',
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * Checks structure search_params.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                foreach ($searchParams as $params) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 134 characters
        Open

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @param string $operator
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                    $sourceRecordModel = self::$recordCache[$recordModel->get($sourceFieldName)] ?? \Vtiger_Record_Model::getInstanceById($recordModel->get($sourceFieldName));
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 134 characters
        Open

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    $result[] = $tempParam;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                return $value;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                if (isset($conditions['rules'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                    return true;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    if (isset($rule['condition'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                } elseif ($recordModel->getModuleName() === $moduleName) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                        } elseif (0 === strpos($param[0], 'relationColumn_') && preg_match('/(^relationColumn_)(\d+)$/', $param[0])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

                            $operator = $condition['operator'];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                        $ruleResult = self::parseConditions($rule, $recordModel);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            public static function checkCondition(array $rule, \Vtiger_Record_Model $recordModel): bool
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 180 characters
        Open

                    Log::error("Not found record field condition | Field name: $fieldName | Module: $moduleName | FieldDataType: " . ucfirst($fieldModel->getFieldDataType()), 'Condition');
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                return $result;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            public static function validSearchValue(string $value, string $moduleName, string $fieldName, string $operator): string
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * Return condition from request.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            $condition = static::getConditionsFromRequest($condition);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    if (!$andCondition && $ruleResult) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $rule['fieldname']), 3, false);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            $value = $relatedFields[$relatedFieldName]->getUITypeModel()->getDbConditionBuilderValue($param[2], $param[1]);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            if (!isset($fields[$param[0]])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                            if (!\in_array($operator, array_merge(self::OPERATORS_WITHOUT_VALUES, self::FIELD_COMPARISON_OPERATORS, array_keys(self::DATE_OPERATORS)))) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 161 characters
        Open

                            if (!\in_array($operator, array_merge(self::OPERATORS_WITHOUT_VALUES, self::FIELD_COMPARISON_OPERATORS, array_keys(self::DATE_OPERATORS)))) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                $andCondition = 'AND' === $conditions['condition'];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

                    foreach ($conditions['rules'] as &$condition) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                        $result = true;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * Check one condition.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                if ($sourceFieldName) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    Log::error("Not found record field condition | Field name: $fieldName | Module: $moduleName | FieldDataType: " . ucfirst($fieldModel->getFieldDataType()), 'Condition');
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                                throw new Exceptions\IllegalValue("ERR_FIELD_NOT_FOUND||{$param[0]}||" . Utils::varExport($param, true), 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @param string $moduleName
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    \Vtiger_Module_Model::getInstance($moduleName)->getField($fieldName)->getUITypeModel()->getDbConditionBuilderValue($value, $operator);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                foreach ($conditions['rules'] as $rule) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

                    throw new \App\Exceptions\AppException("ERR_NOT_FOUND_QUERY_FIELD_CONDITION|$fieldName|$className");
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                        if ($convert) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            $param[2] = $value;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 123 characters
        Open

            public static function validSearchValue(string $value, string $moduleName, string $fieldName, string $operator): string
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        if (isset($condition['condition'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                $className = '\App\Conditions\RecordFields\\' . ucfirst($fieldModel->getFieldDataType()) . 'Field';
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * Checks value search_value.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    $recordField = new $className($sourceRecordModel, $fieldModel, $rule);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                                $value = \Vtiger_Module_Model::getInstance($fieldModuleName)->getFieldByName($fieldName)
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

            public static function checkConditions(array $conditions, \Vtiger_Record_Model $recordModel): bool
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @param string $fieldName
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                if ('' !== $value) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                                    ->getUITypeModel()
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

             * @param array                $rule
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    if ($andCondition && !$ruleResult) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                    Log::error("Not found field model | Field name: $fieldName | Module: $moduleName", 'Condition');
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        $tempParam[] = $param;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 146 characters
        Open

                    \Vtiger_Module_Model::getInstance($moduleName)->getField($fieldName)->getUITypeModel()->getDbConditionBuilderValue($value, $operator);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                            $value = $condition['value'] ?? '';
        Severity: Minor
        Found in app/Condition.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/Condition.php by phpcodesniffer

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

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

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

                    $fieldModel = $sourceRecordModel->getField($fieldName);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                if (!empty($sourceFieldName)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

            public static function getConditionsFromRequest(array $conditions): array
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                                [$fieldName, $fieldModuleName,] = array_pad(explode(':', $condition['fieldname']), 3, false);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

                        $ruleResult = self::checkCondition($rule, $recordModel);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                            $value = (int) $param[2];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            $value = $fields[$param[0]]->getUITypeModel()->getDbConditionBuilderValue($param[2], $param[1]);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @param string $value
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                                    ->getDbConditionBuilderValue($value, $operator);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            $condition['value'] = $value;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @param array|null           $conditions
        Severity: Minor
        Found in app/Condition.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/Condition.php by phpcodesniffer

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

            private static function parseConditions(?array $conditions, \Vtiger_Record_Model $recordModel): bool
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        return false;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    throw new \App\Exceptions\AppException('ERR_NOT_FOUND_FIELD_MODEL|' . $fieldName);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                if (!class_exists($className)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 131 characters
        Open

                            $value = $relatedFields[$relatedFieldName]->getUITypeModel()->getDbConditionBuilderValue($param[2], $param[1]);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 126 characters
        Open

                        } elseif (0 === strpos($param[0], 'relationColumn_') && preg_match('/(^relationColumn_)(\d+)$/', $param[0])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

             * Parse conditions.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        $result = false;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                return $result;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

             * Check all conditions.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                            $fields = array_merge_recursive($fields, static::getFieldsFromConditions($condition));
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            if (($fieldName === $cFieldName && $moduleName === $cModuleName) || ($sourceFieldName && $sourceFieldName === $fieldName && $moduleName === $baseModuleName)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            unset($conditions['rules'][$key]);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        if (!\App\Validator::integer($v)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $condition['fieldname']), 3, false);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                                $fields['baseModule'][] = $fieldName;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        $conditions = [];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

             * Checks structure advancedConditions.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

            public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    foreach ($conditions['rules'] as $key => &$condition) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        if (isset($condition['condition'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            $condition = static::removeFieldFromCondition($baseModuleName, $condition, $moduleName, $fieldName);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                            if ($sourceFieldName) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                                $fields['referenceModule'][$moduleName][$sourceFieldName] = $fieldName;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * Remove field from conditions.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                return $conditions;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                            throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $v, 406);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                    }, $advancedConditions['relationColumns']);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * @param string $moduleName     The module name of the field to be deleted.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                if (!empty($advancedConditions['relationColumns'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                    $recordField->setSource($recordModel, $sourceFieldName);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @return array ['baseModule' => [], 'referenceModule' => []]
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                    foreach ($conditions['rules'] as &$condition) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 130 characters
        Open

                    $advancedConditions['relationConditions'] = self::getConditionsFromRequest($advancedConditions['relationConditions']);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

            public static function getFieldsFromConditions(array $conditions): array
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @param string $fieldName      The name of the field to be deleted
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                    array_map(function ($v) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

             * Get field names from conditions.
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                            [$cFieldName, $cModuleName, $sourceFieldName] = array_pad(explode(':', $condition['fieldname']), 3, false);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                        if (empty($condition)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                        if (isset($condition['condition'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

             * @param array $advancedConditions
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

            public static function validAdvancedConditions(array $advancedConditions): array
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                return $recordField->check();
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 127 characters
        Open

                            [$cFieldName, $cModuleName, $sourceFieldName] = array_pad(explode(':', $condition['fieldname']), 3, false);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 125 characters
        Open

                            [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $condition['fieldname']), 3, false);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

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

        Line exceeds 120 characters; contains 179 characters
        Open

                            if (($fieldName === $cFieldName && $moduleName === $cModuleName) || ($sourceFieldName && $sourceFieldName === $fieldName && $moduleName === $baseModuleName)) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                                $condition = [];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                    $advancedConditions['relationConditions'] = self::getConditionsFromRequest($advancedConditions['relationConditions']);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                $fields = ['baseModule' => [], 'referenceModule' => []];
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                if (isset($conditions['rules'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                if (!empty($advancedConditions['relationConditions']) && 0 != $advancedConditions['relationId']) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

                    $recordField = new $className($recordModel, $fieldModel, $rule);
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                if (isset($conditions['rules'])) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                return $fields;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

                    if (empty($conditions['rules'] = array_filter($conditions['rules']))) {
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

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

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

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

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

             * @param string $baseModuleName The base name of the module for which conditions have been set
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        Line exceeds 120 characters; contains 140 characters
        Open

            public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

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

                return $advancedConditions;
        Severity: Minor
        Found in app/Condition.php by phpcodesniffer

        There are no issues that match your filters.

        Category
        Status