YetiForceCompany/YetiForceCRM

View on GitHub
modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php

Summary

Maintainability
D
1 day
Test Coverage
F
0%

The class VTFieldExpressionEvaluater has 21 public methods. Consider refactoring VTFieldExpressionEvaluater to keep number of public methods under 10.
Open

class VTFieldExpressionEvaluater
{
    public static function __vt_add($arr)
    {
        if (1 == \count($arr)) {

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

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

VTFieldExpressionEvaluater has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class VTFieldExpressionEvaluater
{
    public static function __vt_add($arr)
    {
        if (1 == \count($arr)) {

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

        public static function __vt_time_diff($arr)
        {
            $time_operand1 = $time_operand2 = 0;
            if (\count($arr) > 1) {
                $time_operand1 = $time1 = $arr[0];
    Severity: Minor
    Found in modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.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

    Function exec has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function exec($expr)
        {
            if ($expr instanceof VTExpressionSymbol) {
                return $this->env($expr);
            }
    Severity: Minor
    Found in modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php - About 35 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

    Avoid too many return statements within this method.
    Open

            return $expr;
    Severity: Major
    Found in modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php - About 30 mins to fix

      Reduce the number of returns of this function 4, down to the maximum allowed 3.
      Open

          public static function __vt_get_date($arr)

      Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

      Noncompliant Code Example

      With the default threshold of 3:

      function myFunction(){ // Noncompliant as there are 4 return statements
        if (condition1) {
          return true;
        } else {
          if (condition2) {
            return false;
          } else {
            return true;
          }
        }
        return false;
      }
      

      Reduce the number of returns of this function 5, down to the maximum allowed 3.
      Open

          public function exec($expr)

      Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

      Noncompliant Code Example

      With the default threshold of 3:

      function myFunction(){ // Noncompliant as there are 4 return statements
        if (condition1) {
          return true;
        } else {
          if (condition2) {
            return false;
          } else {
            return true;
          }
        }
        return false;
      }
      

      Class "VTFieldExpressionEvaluater" has 21 methods, which is greater than 20 authorized. Split it into smaller classes.
      Open

      class VTFieldExpressionEvaluater

      A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

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

              } else {
                  $baseTime = date('H:i:s');
                  $minutes = $arr[0];
              }

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

              } else {
                  $noOfDays = $arr[0];
              }

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

              } else {
                  $baseTime = date('H:i:s');
                  $minutes = $arr[0];
              }

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

              } else {
                  $maxDigit = \strlen(substr(strrchr($arr[1], '.'), 1));
              }

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

              } else {
                  // Added as we need to compare with the values based on the user date format and timezone
      
                  $time_operand1 = date('Y-m-d H:i:s'); // Current time
      
      

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

              $time_operand1 = \App\Fields\DateTime::formatToDb($time_operand1, true);

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              } else {
                  $maxDigit = \strlen(substr(strrchr($arr[1], '.'), 1));
              }

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

              $time_operand2 = \App\Fields\DateTime::formatToDb($time_operand2, true);

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              } else {
                  $noOfDays = $arr[0];
              }

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

      Define a constant instead of duplicating this literal "Y-m-d" 6 times.
      Open

                  $baseDate = date('Y-m-d'); // Current date

      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 "H:i:s" 5 times.
      Open

                      return date('H:i:s', $timeDiff);

      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.

      Saw an @param annotation for a, but it was not found in the param list of function __vt_time_diffdays(mixed $arr) : int
      Open

           * @param array $a   $a[0] - Input time1, $a[1] - Input time2

      Reference to undeclared property \VTFieldExpressionEvaluater->env (Did you mean \VTFieldExpressionEvaluater->env() or $_ENV)
      Open

                  return $this->env->get($sym->value);

      Saw an @param annotation for a, but it was not found in the param list of function __vt_time_diff(mixed $arr) : int
      Open

           * @param array $a   $a[0] - Input time1, $a[1] - Input time2

      Returning type string but __vt_time_diff() is declared to return int
      Open

                      return date('H:i:s', $timeDiff);

      Returning type float but __vt_time_diffdays() is declared to return int
      Open

              return floor($timediff / (60 * 60 * 24));

      Reference to undeclared property \VTFieldExpressionEvaluater->operations
      Open

                  $func = $this->operations[$op->value];

      Reference to undeclared property \VTFieldExpressionEvaluater->operators
      Open

              $this->operators = [

      Reference to undeclared property \VTFieldExpressionEvaluater->functions
      Open

              $this->functions = [

      Reference to undeclared property \VTFieldExpressionEvaluater->operations
      Open

              $this->operations = array_merge($this->functions, $this->operators);

      Reference to undeclared property \VTExpressionSymbol->value
      Open

              return $sym->value;

      Reference to undeclared property \VTFieldExpressionEvaluater->operators
      Open

              $this->operations = array_merge($this->functions, $this->operators);

      Reference to undeclared property \VTFieldExpressionEvaluater->expr
      Open

              return $this->exec($this->expr);

      Reference to undeclared property \VTFieldExpressionEvaluater->env (Did you mean \VTFieldExpressionEvaluater->env() or $_ENV)
      Open

              if ($this->env) {

      Reference to undeclared property \VTExpressionSymbol->value
      Open

                  return $this->env->get($sym->value);

      Reference to undeclared property \VTFieldExpressionEvaluater->functions
      Open

              $this->operations = array_merge($this->functions, $this->operators);

      Reference to undeclared property \VTFieldExpressionEvaluater->env (Did you mean \VTFieldExpressionEvaluater->env() or $env)
      Open

              $this->env = $env;

      Reference to undeclared property \VTFieldExpressionEvaluater->expr (Did you mean $expr)
      Open

              $this->expr = $expr;

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              if (\strlen(substr(strrchr($arr[0], '.'), 1)) > \strlen(substr(strrchr($arr[1], '.'), 1))) {
                  $maxDigit = \strlen(substr(strrchr($arr[0], '.'), 1));
              } else {
                  $maxDigit = \strlen(substr(strrchr($arr[1], '.'), 1));
              }
      modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php on lines 32..36

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 150.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              if (\strlen(substr(strrchr($arr[0], '.'), 1)) > \strlen(substr(strrchr($arr[1], '.'), 1))) {
                  $maxDigit = \strlen(substr(strrchr($arr[0], '.'), 1));
              } else {
                  $maxDigit = \strlen(substr(strrchr($arr[1], '.'), 1));
              }
      modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php on lines 18..22

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 150.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public static function __vt_add_time($arr)
          {
              if (\count($arr) > 1) {
                  $baseTime = $arr[0];
                  $minutes = $arr[1];
      modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php on lines 203..215

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 115.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public static function __vt_sub_time($arr)
          {
              if (\count($arr) > 1) {
                  $baseTime = $arr[0];
                  $minutes = $arr[1];
      modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php on lines 189..201

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 115.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class VTFieldExpressionEvaluater

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

                  $op = $expr->getName();

      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

      Method name "VTFieldExpressionEvaluater::__vt_ltequals" is not in camel caps format
      Open

          public static function __vt_ltequals($arr)

      Method name "VTFieldExpressionEvaluater::__vt_gtequals" is not in camel caps format
      Open

          public static function __vt_gtequals($arr)

      Method name "VTFieldExpressionEvaluater::__vt_lt" is not in camel caps format
      Open

          public static function __vt_lt($arr)

      Method name "VTFieldExpressionEvaluater::__vt_div" is not in camel caps format
      Open

          public static function __vt_div($arr)

      Method name "VTFieldExpressionEvaluater::__vt_sub" is not in camel caps format
      Open

          public static function __vt_sub($arr)

      Method name "VTFieldExpressionEvaluater::__vt_time_diff" is not in camel caps format
      Open

          public static function __vt_time_diff($arr)

      Method name "VTFieldExpressionEvaluater::__vt_time_diffdays" is not in camel caps format
      Open

          public static function __vt_time_diffdays($arr)

      Method name "VTFieldExpressionEvaluater::__vt_gt" is not in camel caps format
      Open

          public static function __vt_gt($arr)

      Method name "VTFieldExpressionEvaluater::__vt_sub_time" is not in camel caps format
      Open

          public static function __vt_sub_time($arr)

      Method name "VTFieldExpressionEvaluater::__vt_add" is not in camel caps format
      Open

          public static function __vt_add($arr)

      Method name "VTFieldExpressionEvaluater::__vt_concat" is not in camel caps format
      Open

          public static function __vt_concat($arr)

      Method name "VTFieldExpressionEvaluater::__vt_mul" is not in camel caps format
      Open

          public static function __vt_mul($arr)

      Method name "VTFieldExpressionEvaluater::__vt_equals" is not in camel caps format
      Open

          public static function __vt_equals($arr)

      Method name "VTFieldExpressionEvaluater::__vt_add_days" is not in camel caps format
      Open

          public static function __vt_add_days($arr)

      Method name "VTFieldExpressionEvaluater::__vt_get_date" is not in camel caps format
      Open

          public static function __vt_get_date($arr)

      Method name "VTFieldExpressionEvaluater::__vt_sub_days" is not in camel caps format
      Open

          public static function __vt_sub_days($arr)

      Method name "VTFieldExpressionEvaluater::__vt_add_time" is not in camel caps format
      Open

          public static function __vt_add_time($arr)

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

                  return 0;

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

          public static function __vt_ltequals($arr)

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

          public static function __vt_gtequals($arr)

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

              if (\count($arr) > 1) {

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

                  $time_operand2 = $arr[0];

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

                  return 0;

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

          {

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

          }

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

              return implode('', $arr);

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

                  return $arr[0] / $arr[1];

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

          }

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

          public static function __vt_gt($arr)

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

              return $arr[0] == $arr[1];

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

          public static function __vt_concat($arr)

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

                  // Added as we need to compare with the values based on the user date format and timezone

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

              $time_operand1 = \App\Fields\DateTime::formatToDb($time_operand1, true);

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

          }

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

          {

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

              if (1 == \count($arr)) {

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

                  return $arr[0];

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

              }

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

              } else {

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

          {

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

          }

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

              if (empty($time_operand1) && empty($time_operand2)) {

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

           * Calculate the time difference (input times) or (current time and input time) and

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

          }

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

          }

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

           *

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

              }

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

                  }

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

                  $noOfDays = $arr[1];

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

                  '*' => '__vt_mul',

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

                  '<=' => '__vt_ltequals',

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

                  'sub_time' => '__vt_sub_time',

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

          }

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

           * Gets an environment variable from available sources.

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

              }

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

              return bcadd($arr[0], $arr[1], $maxDigit);

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

              if (1 == \count($arr)) {

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

          }

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

          {

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

          {

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

           * @param mixed $arr

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

           * @param mixed $arr

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

          public static function __vt_sub($arr)

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

          }

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

          public static function __vt_div($arr)

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

              return $arr[0] >= $arr[1];

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

                  $time_operand1 = $time1 = $arr[0];

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

          /**

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

           * @return int number of days

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

              if (null === $baseDate || empty($baseDate)) {

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

              $type = $arr[0] ?? '';

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

                      return date('Y-m-d', strtotime('-1 day'));

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

          {

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

                  '>' => '__vt_gt',

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

                  'time_diff' => '__vt_time_diff',

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

           */

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

              }

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

              }

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

           * @param array $a   $a[0] - Input time1, $a[1] - Input time2

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

           * @return int difference timestamp

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

           */

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

              return strftime('%Y-%m-%d', $baseDate + ($noOfDays * 24 * 60 * 60));

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

                  case 'tomorrow':

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

              if (\count($arr) > 1) {

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

          {

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

              $this->env = $env;

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

              }

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

              if (\strlen(substr(strrchr($arr[0], '.'), 1)) > \strlen(substr(strrchr($arr[1], '.'), 1))) {

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

              } else {

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

          public static function __vt_lt($arr)

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

          {

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

           *

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

                  $time_operand1 = date('Y-m-d H:i:s'); // Current time

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

          }

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

                  $noOfDays = $arr[0];

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

                  $baseTime = date('H:i:s');

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

              }

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

              return date('H:i:s', $endTime);

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

                  $baseDate = $arr[0];

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

          public function __construct($expr)

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

                  $baseDate = date('Y-m-d'); // Current date

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

              ];

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

              }

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

                  $minutes = $arr[0];

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

          public function env(VTExpressionSymbol $sym)

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

                  'sub_days' => '__vt_sub_days',

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

                      $params = $expr->getParams();

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

          {

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

                      $cond = $this->exec($params[0]);

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

              }

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

              return bcsub($arr[0], $arr[1], $maxDigit);

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

          public static function __vt_mul($arr)

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

              } catch (Exception $e) {

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

          {

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

           *                   (if $a[1] is not available $a[0] = Current Time, $a[1] = Input time1)

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

              } else {

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

              return strftime('%Y-%m-%d', $baseDate - ($noOfDays * 24 * 60 * 60));

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

              switch ($type) {

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

              $endTime = strtotime("+$minutes minutes", strtotime($baseTime));

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

          }

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

              $this->operators = [

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

                  '/' => '__vt_div',

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

              if ($expr instanceof VTExpressionSymbol) {

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

              try {

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

          }

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

              return $arr[0] < $arr[1];

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

          {

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

                      $timeDiff = strtotime($time1) - strtotime($time2);

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

           *

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

                  $maxDigit = \strlen(substr(strrchr($arr[1], '.'), 1));

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

          {

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

          }

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

          {

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

              if (null === $baseDate || empty($baseDate)) {

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

                      return date('Y-m-d', strtotime('+1 day'));

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

          }

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

                  $baseTime = $arr[0];

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

              $endTime = strtotime("-$minutes minutes", strtotime($baseTime));

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

                  'get_date' => '__vt_get_date',

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

           *

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

           * @return string

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

                  $maxDigit = \strlen(substr(strrchr($arr[0], '.'), 1));

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

          {

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

                  return -$arr[0];

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

              }

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

          public static function __vt_equals($arr)

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

          /** Date difference between (input times) or (current time and input time).

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

           *                   (if $a[1] is not available $a[0] = Current Time, $a[1] = Input time1)

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

                  $time_operand2 = $time2 = $arr[1];

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

              //to give the difference if it is only time field

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

                  $pattern = '/([01]?[0-9]|2[0-3]):[0-5][0-9]/';

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

                      return date('H:i:s', $timeDiff);

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

              return strtotime($time_operand1) - strtotime($time_operand2);

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

              if (\count($arr) > 1) {

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

              $baseDate = strtotime($match[0]);

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

              $baseDate = strtotime($match[0]);

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

          }

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

              }

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

                  'add_days' => '__vt_add_days',

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

                      return $this->exec($params[2]);

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

                  }

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

              if ($this->env) {

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

          }

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

                  $maxDigit = \strlen(substr(strrchr($arr[0], '.'), 1));

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

                  $maxDigit = \strlen(substr(strrchr($arr[1], '.'), 1));

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

              return (float) $arr[0] * (float) $arr[1];

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

              $time_operand1 = $time_operand2 = 0;

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

              } else {

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

              }

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

              $time_operand2 = \App\Fields\DateTime::formatToDb($time_operand2, true);

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

                  if (preg_match($pattern, $time1) && preg_match($pattern, $time2)) {

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

          public static function __vt_add($arr)

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

           * convert it into number of days.

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

              if (\strlen(substr(strrchr($arr[0], '.'), 1)) > \strlen(substr(strrchr($arr[1], '.'), 1))) {

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

           *

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

          {

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

                  $baseDate = $arr[0];

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

              preg_match('/\d\d\d\d-\d\d-\d\d/', $baseDate, $match);

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

              return $arr[0] <= $arr[1];

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

              }

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

              return $arr[0] > $arr[1];

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

                      return date('Y-m-d');

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

          public static function __vt_time_diff($arr)

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

                  default:

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

              if (empty($time_operand1) || empty($time_operand2)) {

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

                  $baseTime = date('H:i:s');

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

              }

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

                  $minutes = $arr[0];

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

           * @param array $a   $a[0] - Input time1, $a[1] - Input time2

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

              } else {

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

          public static function __vt_time_diffdays($arr)

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

                  '>=' => '__vt_gtequals',

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

          {

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

                  'time_diffdays' => '__vt_time_diffdays',

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

              $timediff = static::__vt_time_diff($arr);

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

              return floor($timediff / (60 * 60 * 24));

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

              $this->expr = $expr;

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

              } else {

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

          {

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

              return $this->exec($this->expr);

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

                  return static::$func($params);

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

          {

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

                      if ($cond) {

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

          /**

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

          }

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

          public static function __vt_sub_days($arr)

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

                  case 'today':

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

          {

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

              return date('H:i:s', $endTime);

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

                  '+' => '__vt_add',

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

           * @param VTExpressionSymbol $sym

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

              }

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

                  $noOfDays = $arr[1];

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

                  $baseTime = $arr[0];

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

          }

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

                  '<' => '__vt_lt',

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

          public function exec($expr)

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

              if ($expr instanceof VTExpressionTreeNode) {

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

                  $params = array_map([$this, 'exec'], $expr->getParams());

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

              return $sym->value;

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

                      return date('Y-m-d');

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

          public static function __vt_sub_time($arr)

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

                  '-' => '__vt_sub',

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

                  'add_time' => '__vt_add_time',

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

                      }

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

                  $func = $this->operations[$op->value];

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

                  return $this->env->get($sym->value);

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

          }

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

          {

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

              if (\count($arr) > 1) {

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

              }

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

          {

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

                  case 'yesterday':

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

              preg_match('/\d\d\d\d-\d\d-\d\d/', $baseDate, $match);

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

              }

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

          public static function __vt_get_date($arr)

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

              if (\count($arr) > 1) {

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

                  $minutes = $arr[1];

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

                  $minutes = $arr[1];

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

                  '==' => '__vt_equals',

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

              } else {

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

                  if ('if' == $op->value) {

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

                  'concat' => '__vt_concat',

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

          }

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

              ];

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

              $this->operations = array_merge($this->functions, $this->operators);

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

                  return $this->env($expr);

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

           *

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

           */

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

          public static function __vt_add_days($arr)

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

                  $noOfDays = $arr[0];

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

                  $baseDate = date('Y-m-d'); // Current date

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

          public static function __vt_add_time($arr)

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

              }

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

              $this->functions = [

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

          public function evaluate($env)

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

          }

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

                  $op = $expr->getName();

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

                          return $this->exec($params[1]);

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

              return $expr;

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand1 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $time_operand2 is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The method __vt_add is not named in camelCase.
      Open

          public static function __vt_add($arr)
          {
              if (1 == \count($arr)) {
                  return $arr[0];
              }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_equals is not named in camelCase.
      Open

          public static function __vt_equals($arr)
          {
              return $arr[0] == $arr[1];
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_time_diffdays is not named in camelCase.
      Open

          public static function __vt_time_diffdays($arr)
          {
              $timediff = static::__vt_time_diff($arr);
              return floor($timediff / (60 * 60 * 24));
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_ltequals is not named in camelCase.
      Open

          public static function __vt_ltequals($arr)
          {
              return $arr[0] <= $arr[1];
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_add_days is not named in camelCase.
      Open

          public static function __vt_add_days($arr)
          {
              if (\count($arr) > 1) {
                  $baseDate = $arr[0];
                  $noOfDays = $arr[1];

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_add_time is not named in camelCase.
      Open

          public static function __vt_add_time($arr)
          {
              if (\count($arr) > 1) {
                  $baseTime = $arr[0];
                  $minutes = $arr[1];

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_sub is not named in camelCase.
      Open

          public static function __vt_sub($arr)
          {
              if (1 == \count($arr)) {
                  return -$arr[0];
              }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_div is not named in camelCase.
      Open

          public static function __vt_div($arr)
          {
              try {
                  return $arr[0] / $arr[1];
              } catch (Exception $e) {

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_sub_days is not named in camelCase.
      Open

          public static function __vt_sub_days($arr)
          {
              if (\count($arr) > 1) {
                  $baseDate = $arr[0];
                  $noOfDays = $arr[1];

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_sub_time is not named in camelCase.
      Open

          public static function __vt_sub_time($arr)
          {
              if (\count($arr) > 1) {
                  $baseTime = $arr[0];
                  $minutes = $arr[1];

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_gt is not named in camelCase.
      Open

          public static function __vt_gt($arr)
          {
              return $arr[0] > $arr[1];
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_get_date is not named in camelCase.
      Open

          public static function __vt_get_date($arr)
          {
              $type = $arr[0] ?? '';
              switch ($type) {
                  case 'today':

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_mul is not named in camelCase.
      Open

          public static function __vt_mul($arr)
          {
              return (float) $arr[0] * (float) $arr[1];
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_gtequals is not named in camelCase.
      Open

          public static function __vt_gtequals($arr)
          {
              return $arr[0] >= $arr[1];
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_lt is not named in camelCase.
      Open

          public static function __vt_lt($arr)
          {
              return $arr[0] < $arr[1];
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_concat is not named in camelCase.
      Open

          public static function __vt_concat($arr)
          {
              return implode('', $arr);
          }

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method __vt_time_diff is not named in camelCase.
      Open

          public static function __vt_time_diff($arr)
          {
              $time_operand1 = $time_operand2 = 0;
              if (\count($arr) > 1) {
                  $time_operand1 = $time1 = $arr[0];

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status