YetiForceCompany/YetiForceCRM

View on GitHub
app/EventHandler.php

Summary

Maintainability
C
1 day
Test Coverage
C
74%

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

class EventHandler
{
    /**
     * Table name.
     *
Severity: Minor
Found in app/EventHandler.php by phpmd

File EventHandler.php has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App;

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

    EventHandler has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class EventHandler
    {
        /**
         * Table name.
         *
    Severity: Minor
    Found in app/EventHandler.php - About 2 hrs to fix

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

          public static function getByType(string $name, ?string $moduleName = '', bool $active = true): array
          {
              $handlersByType = [];
              $cacheName = 'All' . ($active ? ':active' : '');
              if (Cache::has('EventHandlerByType', $cacheName)) {
      Severity: Minor
      Found in app/EventHandler.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 registerHandler has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function registerHandler(string $eventName, string $className, $includeModules = '', $excludeModules = '', $priority = 5, $isActive = true, $ownerId = 0, $mode = 1): bool
      Severity: Major
      Found in app/EventHandler.php - About 1 hr to fix

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

            public static function getVarsByType(string $name, string $moduleName, array $params, bool $byKey = false): string
            {
                $return = [];
                foreach (self::getByType($name, $moduleName) as $key => $handler) {
                    $className = $handler['handler_class'];
        Severity: Minor
        Found in app/EventHandler.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 checkActive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function checkActive(string $className, ?string $eventName = null): bool
            {
                $rows = (new \App\Db\Query())->from(self::$baseTable)->where(['handler_class' => $className])->all();
                $status = false;
                foreach ($rows as $row) {
        Severity: Minor
        Found in app/EventHandler.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

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

            public function getHandlers(string $name): array
            {
                $handlers = static::getByType($name, $this->moduleName);
                if ($this->exceptions['disableHandlers'] ?? null) {
                    $handlers = array_intersect_key($handlers, array_flip(self::$mandatoryEventClass));
        Severity: Minor
        Found in app/EventHandler.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

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

            public static function getByType(string $name, ?string $moduleName = '', bool $active = true): array
            {
                $handlersByType = [];
                $cacheName = 'All' . ($active ? ':active' : '');
                if (Cache::has('EventHandlerByType', $cacheName)) {
        Severity: Minor
        Found in app/EventHandler.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

        This function has 8 parameters, which is greater than the 7 authorized.
        Open

            public static function registerHandler(string $eventName, string $className, $includeModules = '', $excludeModules = '', $priority = 5, $isActive = true, $ownerId = 0, $mode = 1): bool
        Severity: Major
        Found in app/EventHandler.php by sonar-php

        A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

        Noncompliant Code Example

        With a maximum number of 4 parameters:

        function doSomething($param1, $param2, $param3, $param4, $param5) {
        ...
        }
        

        Compliant Solution

        function doSomething($param1, $param2, $param3, $param4) {
        ...
        }
        

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

        class EventHandler
        Severity: Major
        Found in app/EventHandler.php by sonar-php

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

            public static function setInActive($className, $eventName = false)
        Severity: Minor
        Found in app/EventHandler.php by phpmd

        BooleanArgumentFlag

        Since: 1.4.0

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

        Example

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

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

        Missing class import via use statement (line '298', column '16').
        Open

                $rows = (new \App\Db\Query())->from(self::$baseTable)->where(['handler_class' => $className])->all();
        Severity: Minor
        Found in app/EventHandler.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 getAll has a boolean flag argument $active, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function getAll(bool $active = true): array
        Severity: Minor
        Found in app/EventHandler.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

        The method registerHandler has a boolean flag argument $isActive, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function registerHandler(string $eventName, string $className, $includeModules = '', $excludeModules = '', $priority = 5, $isActive = true, $ownerId = 0, $mode = 1): bool
        Severity: Minor
        Found in app/EventHandler.php by phpmd

        BooleanArgumentFlag

        Since: 1.4.0

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

        Example

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

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

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

                $query = (new \App\Db\Query())->from(self::$baseTable)->orderBy(['priority' => SORT_DESC]);
        Severity: Minor
        Found in app/EventHandler.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 deleteHandler has a boolean flag argument $eventName, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function deleteHandler($className, $eventName = false)
        Severity: Minor
        Found in app/EventHandler.php by phpmd

        BooleanArgumentFlag

        Since: 1.4.0

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

        Example

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

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

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

                    throw new \App\Exceptions\AppException('LBL_HANDLER_NOT_FOUND');
        Severity: Minor
        Found in app/EventHandler.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 getVarsByType has a boolean flag argument $byKey, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function getVarsByType(string $name, string $moduleName, array $params, bool $byKey = false): string
        Severity: Minor
        Found in app/EventHandler.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

        The method setActive has a boolean flag argument $eventName, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function setActive($className, $eventName = false)
        Severity: Minor
        Found in app/EventHandler.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

        The method getByType has a boolean flag argument $active, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function getByType(string $name, ?string $moduleName = '', bool $active = true): array
        Severity: Minor
        Found in app/EventHandler.php by phpmd

        BooleanArgumentFlag

        Since: 1.4.0

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

        Example

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

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

        Missing class import via use statement (line '229', column '20').
        Open

                $isExists = (new \App\Db\Query())->from(self::$baseTable)->where(['event_name' => $eventName, 'handler_class' => $className])->exists();
        Severity: Minor
        Found in app/EventHandler.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

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

                    Cache::save('EventHandlerByType', $cacheName, $handlersByType, Cache::LONG);
        Severity: Minor
        Found in app/EventHandler.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

        Avoid using static access to class 'App\Purifier' in method 'getVarsByType'.
        Open

                return Purifier::encodeHtml(Json::encode($return));
        Severity: Minor
        Found in app/EventHandler.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 triggerHandler uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $handler = $this->handlers[$className] = new $className();
                }
        Severity: Minor
        Found in app/EventHandler.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 getByType uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    foreach (self::getAll($active) as $handler) {
                        $handlersByType[$handler['event_name']][$handler['handler_class']] = $handler;
                    }
                    Cache::save('EventHandlerByType', $cacheName, $handlersByType, Cache::LONG);
        Severity: Minor
        Found in app/EventHandler.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\Cache' in method 'clearCache'.
        Open

                Cache::delete('EventHandlerByType', 'All');
        Severity: Minor
        Found in app/EventHandler.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 getVarsByType uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                        } else {
                            $return = array_values(array_unique(array_merge($return, $vars)));
                        }
        Severity: Minor
        Found in app/EventHandler.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\Cache' in method 'clearCache'.
        Open

                Cache::delete('EventHandlerByType', 'All:active');
        Severity: Minor
        Found in app/EventHandler.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 'triggerHandler'.
        Open

                    Log::error("Handler not found, class: {$className} | {$function}");
        Severity: Minor
        Found in app/EventHandler.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 '201', column '46').
        Open

            public static function getVarsByType(string $name, string $moduleName, array $params, bool $byKey = false): string
            {
                $return = [];
                foreach (self::getByType($name, $moduleName) as $key => $handler) {
                    $className = $handler['handler_class'];
        Severity: Minor
        Found in app/EventHandler.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 assigning values to variables in if clauses and the like (line '457', column '13').
        Open

            public function getHandlers(string $name): array
            {
                $handlers = static::getByType($name, $this->moduleName);
                if ($this->exceptions['disableHandlers'] ?? null) {
                    $handlers = array_intersect_key($handlers, array_flip(self::$mandatoryEventClass));
        Severity: Minor
        Found in app/EventHandler.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\Cache' in method 'getByType'.
        Open

                    $handlersByType = Cache::get('EventHandlerByType', $cacheName);
        Severity: Minor
        Found in app/EventHandler.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\Cache' in method 'getByType'.
        Open

                if (Cache::has('EventHandlerByType', $cacheName)) {
        Severity: Minor
        Found in app/EventHandler.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\Json' in method 'getVarsByType'.
        Open

                return Purifier::encodeHtml(Json::encode($return));
        Severity: Minor
        Found in app/EventHandler.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 "modulesExcluded" 8 times.
        Open

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Critical
        Found in app/EventHandler.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 "include_modules" 3 times.
        Open

                        if ((!empty($handler['include_modules']) && !\in_array($moduleName, explode(',', $handler['include_modules']))) || (!empty($handler['exclude_modules']) && \in_array($moduleName, explode(',', $handler['exclude_modules'])))) {
        Severity: Critical
        Found in app/EventHandler.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 "active" 8 times.
        Open

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Critical
        Found in app/EventHandler.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 "event_name" 8 times.
        Open

                        $handlersByType[$handler['event_name']][$handler['handler_class']] = $handler;
        Severity: Critical
        Found in app/EventHandler.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 "columns" 8 times.
        Open

                    'columns' => [
        Severity: Critical
        Found in app/EventHandler.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 "eventName" 8 times.
        Open

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Critical
        Found in app/EventHandler.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 "eventDescription" 8 times.
        Open

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Critical
        Found in app/EventHandler.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 "EventHandlerByType" 5 times.
        Open

                if (Cache::has('EventHandlerByType', $cacheName)) {
        Severity: Critical
        Found in app/EventHandler.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 "LBL_EVENT_DESC" 8 times.
        Open

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Critical
        Found in app/EventHandler.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.

        Rename "$handlers" which has the same name as the field declared at line 28.
        Open

                $handlers = static::getByType($name, $this->moduleName);
        Severity: Major
        Found in app/EventHandler.php by sonar-php

        Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

        Noncompliant Code Example

        class Foo {
          public $myField;
        
          public function doSomething() {
            $myField = 0;
            ...
          }
        }
        

        See

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

                    $query->where(['is_active' => 1]);
        Severity: Critical
        Found in app/EventHandler.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 "exclude_modules" 3 times.
        Open

                        if ((!empty($handler['include_modules']) && !\in_array($moduleName, explode(',', $handler['include_modules']))) || (!empty($handler['exclude_modules']) && \in_array($moduleName, explode(',', $handler['exclude_modules'])))) {
        Severity: Critical
        Found in app/EventHandler.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 "LBL_EVENT_NAME" 8 times.
        Open

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Critical
        Found in app/EventHandler.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 "LBL_INCLUDE_MODULES" 8 times.
        Open

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Critical
        Found in app/EventHandler.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 "modules" 8 times.
        Open

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Critical
        Found in app/EventHandler.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 "LBL_EXCLUDE_MODULES" 8 times.
        Open

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Critical
        Found in app/EventHandler.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" 48 times.
        Open

                    'label' => 'LBL_EDIT_VIEW_PRESAVE',
        Severity: Critical
        Found in app/EventHandler.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 "LBL_EVENT_IS_ACTIVE" 8 times.
        Open

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Critical
        Found in app/EventHandler.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 "handler_class" 9 times.
        Open

                        $handlersByType[$handler['event_name']][$handler['handler_class']] = $handler;
        Severity: Critical
        Found in app/EventHandler.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 undeclared method \App\Db::createCommand
        Open

                    $return = \App\Db::getInstance()->createCommand()
        Severity: Critical
        Found in app/EventHandler.php by phan

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

                \App\Db::getInstance()->createCommand()->delete(self::$baseTable, $params)->execute();
        Severity: Critical
        Found in app/EventHandler.php by phan

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

                $isExists = (new \App\Db\Query())->from(self::$baseTable)->where(['event_name' => $eventName, 'handler_class' => $className])->exists();
        Severity: Critical
        Found in app/EventHandler.php by phan

        Doc-block of $moduleName in getByType is phpdoc param type string which is not a permitted replacement of the nullable param type ?string declared in the signature ('?T' should be documented as 'T|null' or '?T')
        Open

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

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

                Db::getInstance()->createCommand()->update(self::$baseTable, $params, ['eventhandler_id' => $id])->execute();
        Severity: Critical
        Found in app/EventHandler.php by phan

        Saw an @param annotation for params, but it was not found in the param list of function addParams(mixed $key, mixed $value)
        Open

             * @param array $params
        Severity: Info
        Found in app/EventHandler.php by phan

        Invalid offset "disableHandlerClasses" of array type array{}
        Open

                } elseif ($disableHandlers = $this->exceptions['disableHandlerClasses'] ?? null) {
        Severity: Minor
        Found in app/EventHandler.php by phan

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

                \App\Db::getInstance()->createCommand()->update(self::$baseTable, ['is_active' => true], $params)->execute();
        Severity: Critical
        Found in app/EventHandler.php by phan

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

                $rows = (new \App\Db\Query())->from(self::$baseTable)->where(['handler_class' => $className])->all();
        Severity: Critical
        Found in app/EventHandler.php by phan

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

                    Log::error("Handler not found, class: {$className} | {$function}");
        Severity: Critical
        Found in app/EventHandler.php by phan

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

                \App\Db::getInstance()->createCommand()
        Severity: Critical
        Found in app/EventHandler.php by phan

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

                $query = (new \App\Db\Query())->from(self::$baseTable)->orderBy(['priority' => SORT_DESC]);
        Severity: Critical
        Found in app/EventHandler.php by phan

        Invalid offset "disableHandlers" of array type array{}
        Open

                if ($this->exceptions['disableHandlers'] ?? null) {
        Severity: Minor
        Found in app/EventHandler.php by phan

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

            public static function setInActive($className, $eventName = false)
            {
                $params = ['handler_class' => $className];
                if ($eventName) {
                    $params['event_name'] = $eventName;
        Severity: Minor
        Found in app/EventHandler.php and 1 other location - About 30 mins to fix
        app/EventHandler.php on lines 335..343

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

        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 setActive($className, $eventName = false)
            {
                $params = ['handler_class' => $className];
                if ($eventName) {
                    $params['event_name'] = $eventName;
        Severity: Minor
        Found in app/EventHandler.php and 1 other location - About 30 mins to fix
        app/EventHandler.php on lines 318..327

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

        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

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

            public static function update(array $params, int $id)
        Severity: Minor
        Found in app/EventHandler.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

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

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

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

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

             * Handler types.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                    'label' => 'LBL_EDIT_VIEW_PRESAVE',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'fas fa-pallet',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            private $exceptions = [];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public const HANDLER_TYPES = [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'EditViewPreSave' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public const EDIT_VIEW_CHANGE_VALUE = 'EditViewChangeValue';
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'label' => 'LBL_EDIT_VIEW_DUPLICATE',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            /** @var int Handler is in system mode, no editing possible */
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'EntityBeforeSave' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'label' => 'LBL_ENTITY_AFTER_SAVE',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            private $moduleName;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            private $params;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'fas fa-clone',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Table name.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public const SYSTEM = 0;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public const RECORD_CONVERTER_AFTER_SAVE = 'RecordConverterAfterSave';
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'label' => 'LBL_DETAIL_VIEW_BEFORE',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'mdi mdi-account-details c-mdi',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'EditViewBefore' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'label' => 'LBL_INVENTORY_RECORD_DETAILS',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            /** @var string Edit view, change value */
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @var array
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'label' => 'LBL_ENTITY_CHANGE_STATE',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'label' => 'LBL_EDIT_VIEW_BEFORE',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

            private static $mandatoryEventClass = ['ModTracker_ModTrackerHandler_Handler'];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            /** @var int Handler is in edit mode */
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'EntityChangeState' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'label' => 'LBL_ENTITY_BEFORE_SAVE',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'yfi yfi-full-editing-view ',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

            public const EDITABLE = 1;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventName' => ['label' => 'LBL_EVENT_NAME'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'eventDescription' => ['label' => 'LBL_EVENT_DESC'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            private $handlers = [];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public const EDIT_VIEW_PRE_SAVE = 'EditViewPreSave';
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'fas fa-step-backward',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            protected static $baseTable = 'vtiger_eventhandlers';
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            /** @var string Edit view, validation before saving */
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'far fa-save',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'active' => ['label' => 'LBL_EVENT_IS_ACTIVE'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            /** @var string Record converter after create record */
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'fas fa-save',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'EditViewDuplicate' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            private $recordModel;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'icon' => 'fas fa-compass',
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'EntityAfterSave' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    'columns' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'InventoryRecordDetails' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

                            $return[$key] = $vars;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        ->insert(self::$baseTable, [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * Unregister a registered handler.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                    Cache::save('EventHandlerByType', $cacheName, $handlersByType, Cache::LONG);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @param string $eventName      The name of the event to handle
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                            'handler_class' => $className,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                        'modulesExcluded' => ['label' => 'LBL_EXCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                'DetailViewBefore' => [
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        'modules' => ['label' => 'LBL_INCLUDE_MODULES'],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                    foreach ($handlers as $key => $handler) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public static function getVarsByType(string $name, string $moduleName, array $params, bool $byKey = false): string
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                return Purifier::encodeHtml(Json::encode($return));
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                $return = false;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                            'include_modules' => $includeModules,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public static function clearCache(): void
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                Cache::delete('EventHandlerByType', 'All:active');
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                foreach (self::getByType($name, $moduleName) as $key => $handler) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    $className = $handler['handler_class'];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @param int    $priority
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                            'priority' => $priority,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @param bool|string $eventName
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public static function deleteHandler($className, $eventName = false)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                Db::getInstance()->createCommand()->update(self::$baseTable, $params, ['eventhandler_id' => $id])->execute();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                static::clearCache();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Get all event handlers.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $query = (new \App\Db\Query())->from(self::$baseTable)->orderBy(['priority' => SORT_DESC]);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                if (Cache::has('EventHandlerByType', $cacheName)) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

        Line exceeds 120 characters; contains 240 characters
        Open

                        if ((!empty($handler['include_modules']) && !\in_array($moduleName, explode(',', $handler['include_modules']))) || (!empty($handler['exclude_modules']) && \in_array($moduleName, explode(',', $handler['exclude_modules'])))) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                            unset($handlers[$key]);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                    $return = \App\Db::getInstance()->createCommand()
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $params = ['handler_class' => $className];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                    $params['event_name'] = $eventName;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                    if (method_exists($className, 'vars') && ($vars = (new $className())->vars($name, $params, $moduleName))) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * Register an event handler.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                            'is_active' => $isActive,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * Clear cache.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

             * @param int    $mode
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public static function registerHandler(string $eventName, string $className, $includeModules = '', $excludeModules = '', $priority = 5, $isActive = true, $ownerId = 0, $mode = 1): bool
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

                \App\Db::getInstance()->createCommand()->delete(self::$baseTable, $params)->execute();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

            public static function getAll(bool $active = true): array
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

            public static function getByType(string $name, ?string $moduleName = '', bool $active = true): array
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                $cacheName = 'All' . ($active ? ':active' : '');
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 188 characters
        Open

            public static function registerHandler(string $eventName, string $className, $includeModules = '', $excludeModules = '', $priority = 5, $isActive = true, $ownerId = 0, $mode = 1): bool
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

        Line exceeds 120 characters; contains 144 characters
        Open

                $isExists = (new \App\Db\Query())->from(self::$baseTable)->where(['event_name' => $eventName, 'handler_class' => $className])->exists();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                            'event_name' => $eventName,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Update an event handler.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @param int   $id
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                    foreach (self::getAll($active) as $handler) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                            $return = array_values(array_unique(array_merge($return, $vars)));
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                            'owner_id' => $ownerId,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                static::clearCache();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public static function update(array $params, int $id)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                        if ((!empty($handler['include_modules']) && !\in_array($moduleName, explode(',', $handler['include_modules']))) || (!empty($handler['exclude_modules']) && \in_array($moduleName, explode(',', $handler['exclude_modules'])))) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                $isExists = (new \App\Db\Query())->from(self::$baseTable)->where(['event_name' => $eventName, 'handler_class' => $className])->exists();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                    $handlersByType = Cache::get('EventHandlerByType', $cacheName);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                    $query->where(['is_active' => 1]);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                $handlers = $handlersByType[$name] ?? [];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                return $handlers;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                return $query->indexBy('eventhandler_id')->all();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                if (!$isExists) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                            'exclude_modules' => $excludeModules,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                            'privileges' => $mode,
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                Cache::delete('EventHandlerByType', 'All');
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * Check if it is active function.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $rows = (new \App\Db\Query())->from(self::$baseTable)->where(['handler_class' => $className])->all();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

             * @param bool|string $eventName
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                $this->moduleName = $moduleName;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

            public function getModuleName()
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

             * Set exceptions.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

            public function setExceptions(array $exceptions)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @param string $name Event name
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Get active event handlers by type (event_name).
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

             * Get vars event handlers by type (event_name).
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @param int    $ownerId
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                    ],
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        $handlersByType[$handler['event_name']][$handler['handler_class']] = $handler;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    static::clearCache();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                    if (isset($eventName) && $eventName !== $row['event_name']) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

                    $params['event_name'] = $eventName;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $this->moduleName = $recordModel->getModuleName();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                return $this->params[$key] ?? null;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    $status = true;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                static::clearCache();
        Severity: Minor
        Found in app/EventHandler.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/EventHandler.php by phpcodesniffer

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

            public function setModuleName($moduleName)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

            public function addParams($key, $value)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

            public static function setActive($className, $eventName = false)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $this->recordModel = $recordModel;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $this->params[$key] = $value;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

             * @param string|null $eventName
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                    if (empty($row['is_active'])) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                \App\Db::getInstance()->createCommand()->update(self::$baseTable, ['is_active' => true], $params)->execute();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                static::clearCache();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

             * Set module name.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Get module name.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $this->exceptions = $exceptions;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

             * Set record model.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

                    ->update(self::$baseTable, ['is_active' => false], $params)->execute();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

             * @param mixed $key
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

            public static function checkActive(string $className, ?string $eventName = null): bool
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                return $status;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $params = ['handler_class' => $className];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

             * Get record model.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public function getRecordModel()
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @return array Additional parameters
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * Trigger an event.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                foreach ($this->getHandlers($name) as $handler) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                $status = false;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                $this->params = $params;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                $function = lcfirst($handler['event_name']);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                \App\Db::getInstance()->createCommand()
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public function setRecordModel(\Vtiger_Record_Model $recordModel)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

                return $this->recordModel;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public function getParam(string $key)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                if ($this->exceptions['disableHandlers'] ?? null) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

             * Set an event handler as inactive.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Set params.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Add param.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * @return \Vtiger_Record_Model
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

                $handlers = static::getByType($name, $this->moduleName);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                $className = $handler['handler_class'];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                $params = ['handler_class' => $className];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * Set an event handler as active.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                return $this->params;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public function getHandlers(string $name): array
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                    $params['event_name'] = $eventName;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

             * @param bool|string $eventName
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

            public function setParams($params)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

                return $this->moduleName;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

                foreach ($rows as $row) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                    $handlers = array_intersect_key($handlers, array_flip(self::$mandatoryEventClass));
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                        if (isset($handlers[$className])) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

            public static function setInActive($className, $eventName = false)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

             * Get params.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public function getParams()
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                return $handlers;
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

            public function trigger(string $name)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    Log::error("Handler not found, class: {$className} | {$function}");
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    $handler = $this->handlers[$className];
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

            public function triggerHandler(array $handler)
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * Trigger handler.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * @param string $name Event name
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                if (!method_exists($className, $function)) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    throw new \App\Exceptions\AppException('LBL_HANDLER_NOT_FOUND');
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    foreach ($disableHandlers as $className) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

             * Get param.
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * @return mixed
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

             * @return array Handlers list
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                } elseif ($disableHandlers = $this->exceptions['disableHandlerClasses'] ?? null) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                if (isset($this->handlers[$className])) {
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                return $handler->{$function}($this);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                            unset($handlers[$className]);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    $handler = $this->handlers[$className] = new $className();
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

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

                    $this->triggerHandler($handler);
        Severity: Minor
        Found in app/EventHandler.php by phpcodesniffer

        There are no issues that match your filters.

        Category
        Status