YetiForceCompany/YetiForceCRM

View on GitHub
app/Conditions/QueryFields/OwnerField.php

Summary

Maintainability
A
25 mins
Test Coverage
F
0%

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

    public function getMemberValue($member)
    {
        if (is_numeric($member)) {
            return $member;
        }
Severity: Minor
Found in app/Conditions/QueryFields/OwnerField.php - About 25 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

            $condition = [$this->getColumnName() => (new \yii\db\Expression('0=1'))];

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '113', column '52').
Open

                $condition[] = [$this->getColumnName() => (new \App\Db\Query())->select(['userid'])->from(["condition_groups_{$idGroup}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $idGroup)])];

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

    public function getOrderBy($order = false): array

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

                $value = (new \App\Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $id)]);

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

        } else {
            $condition = [$this->getColumnName() => (new \yii\db\Expression('0=1'))];
        }

ElseExpression

Since: 1.4.0

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

Example

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

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

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

            } else {
                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 1]]];
            }

ElseExpression

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\App\PrivilegeUtil' in method 'getMemberValue'.
Open

                $value = \App\PrivilegeUtil::getQueryToUsersByRoleAndSubordinate($id);

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\User' in method 'operatorOm'.
Open

        return [$this->getColumnName() => \App\User::getCurrentUserId()];

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\Vtiger_Watchdog_Model' in method 'operatorWr'.
Open

        $watchdog = \Vtiger_Watchdog_Model::getInstance($this->getModuleName());

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\Layout' in method 'getMemberValue'.
Open

                $value = (new \App\Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $id)]);

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

            } else {
                $condition = ['u_#__watchdog_record.state' => 1, 'u_#__watchdog_record.userid' => $watchdog->get('userId')];
            }

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\User' in method 'operatorNom'.
Open

        return ['<>', $this->getColumnName(), \App\User::getCurrentUserId()];

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\Layout' in method 'operatorOgu'.
Open

                $condition[] = [$this->getColumnName() => (new \App\Db\Query())->select(['userid'])->from(["condition_groups_{$idGroup}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $idGroup)])];

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\PrivilegeUtil' in method 'getMemberValue'.
Open

                $value = (new \App\Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $id)]);

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\PrivilegeUtil' in method 'operatorOgu'.
Open

                $condition[] = [$this->getColumnName() => (new \App\Db\Query())->select(['userid'])->from(["condition_groups_{$idGroup}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $idGroup)])];

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\PrivilegeUtil' in method 'getMemberValue'.
Open

                $value = \App\PrivilegeUtil::getQueryToUsersByRole($id);

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\Vtiger_Watchdog_Model' in method 'operatorNwr'.
Open

        $watchdog = \Vtiger_Watchdog_Model::getInstance($this->getModuleName());

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 "u_#__watchdog_record.state" 4 times.
Open

                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 0]]];

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

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

Noncompliant Code Example

With the default threshold of 3:

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

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

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

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

                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 0]]];

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

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

Noncompliant Code Example

With the default threshold of 3:

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

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

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

Define a constant instead of duplicating this literal "u_#__watchdog_record.userid" 4 times.
Open

                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 0]]];

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

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

Noncompliant Code Example

With the default threshold of 3:

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

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

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

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

            $this->queryGenerator->addJoin(['LEFT JOIN', 'u_#__watchdog_record', 'vtiger_crmentity.crmid = u_#__watchdog_record.record']);

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\Query::select
Open

                $condition[] = [$this->getColumnName() => (new \App\Db\Query())->select(['userid'])->from(["condition_groups_{$idGroup}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $idGroup)])];
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

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

                $value = (new \App\Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $id)]);
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method __construct from undeclared class \yii\db\Expression
Open

            $condition = [$this->getColumnName() => (new \yii\db\Expression('0=1'))];
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method getInstance from undeclared class \App\Fields\Owner
Open

        $groups = \App\Fields\Owner::getInstance($this->getModuleName())->getGroups(false, 'private');
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

        return [$this->getColumnName() => \App\User::getCurrentUserId()];
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method addJoin from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $this->queryGenerator->addJoin(['LEFT JOIN', 'u_#__watchdog_record', 'vtiger_crmentity.crmid = u_#__watchdog_record.record']);
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method addJoin from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_users', 'vtiger_users.id = ' . $this->getColumnName()]);
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method getInstance from undeclared class \App\Fields\Owner
Open

        $groups = \App\Fields\Owner::getInstance($this->getModuleName())->getGroups(false, 'private');
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

        return ['<>', $this->getColumnName(), \App\User::getCurrentUserId()];
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method addJoin from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $this->queryGenerator->addJoin(['LEFT JOIN', 'u_#__watchdog_record', 'vtiger_crmentity.crmid = u_#__watchdog_record.record']);
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

Call to method addJoin from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_groups', 'vtiger_groups.groupid = ' . $this->getColumnName()]);
Severity: Critical
Found in app/Conditions/QueryFields/OwnerField.php by phan

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

        [$type, $id] = explode(':', $member);

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

Expected 1 space before "as"; 2 found
Open

            foreach (array_keys($groups)  as $idGroup) {

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

                break;

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

     * @return array

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

        return $condition;

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

    {

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

     *

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

    public function getMemberValue($member)

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

            case \App\PrivilegeUtil::MEMBER_TYPE_ROLES:

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

     */

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

            $this->value = explode('##', $this->value);

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

     * Gets conditions for member.

Line exceeds 120 characters; contains 189 characters
Open

                $value = (new \App\Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $id)]);

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

        }

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

        $condition = ['and'];

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

        [$type, $id] = explode(':', $member);

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

     */

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

        if (!\is_array($this->value)) {

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

        }

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

        }

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

     *

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

    }

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

     * Not equal operator.

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

            case \App\PrivilegeUtil::MEMBER_TYPE_GROUPS:

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

            $condition[] = [$this->getColumnName() => $this->getMemberValue($value)];

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

     */

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

        if (is_numeric($member)) {

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

                $value = \App\PrivilegeUtil::getQueryToUsersByRoleAndSubordinate($id);

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

    {

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

        switch ($type) {

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

            case \App\PrivilegeUtil::MEMBER_TYPE_ROLE_AND_SUBORDINATES:

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

                break;

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

        }

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

    /**

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

     * @param int|string $member

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

     * @return \App\Db\Query|int

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

            return $member;

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

     *

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

        $condition = ['or'];

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

    /**

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

    public function operatorN(): array

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

        }

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

        return $condition;

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

                $value = \App\PrivilegeUtil::getQueryToUsersByRole($id);

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

                break;

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

    /**

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

     * Equals operator.

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

    public function operatorE(): array

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

        if (!\is_array($this->value)) {

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

            $this->value = explode('##', $this->value);

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

        foreach ($this->value as $value) {

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

     *

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

     * @return array

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

        foreach ($this->value as $value) {

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

            $condition[] = ['not in', $this->getColumnName(), $this->getMemberValue($value)];

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

    }

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

    public function operatorOgr(): array

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

        return [$this->getColumnName() => \array_keys($groups)];

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

    public function operatorOgu(): array

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

    {

Line exceeds 120 characters; contains 232 characters
Open

                $condition[] = [$this->getColumnName() => (new \App\Db\Query())->select(['userid'])->from(["condition_groups_{$idGroup}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $idGroup)])];

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

            }

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

        return $condition;

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

    }

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

    /**

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

    {

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

        if ($watchdog->isActive()) {

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

                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 1]]];

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

     * @param mixed $order

Line exceeds 120 characters; contains 124 characters
Open

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_groups', 'vtiger_groups.groupid = ' . $this->getColumnName()]);

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

    /**

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

    public function operatorOm()

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

        return [$this->getColumnName() => \App\User::getCurrentUserId()];

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

        if ($watchdog->isActive()) {

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

                $condition = ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 0];

Line exceeds 120 characters; contains 139 characters
Open

            return ['vtiger_users.last_name' => SORT_DESC, 'vtiger_users.first_name' => SORT_DESC, 'vtiger_groups.groupname' => SORT_DESC];

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

            ['not', [$this->getColumnName() => null]],

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

    {

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

    {

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

                $value = (new \App\Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $id)]);

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

        $groups = \App\Fields\Owner::getInstance($this->getModuleName())->getGroups(false, 'private');

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

     * Watched record.

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

        $condition = [];

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

            if ($watchdog->isWatchingModule()) {

Line exceeds 120 characters; contains 138 characters
Open

            $this->queryGenerator->addJoin(['LEFT JOIN', 'u_#__watchdog_record', 'vtiger_crmentity.crmid = u_#__watchdog_record.record']);

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

     * Get order by.

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

     * @return array

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

    }

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

    }

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

        }

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

        return $value;

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

    {

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

     *

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

    {

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

    }

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

        if ($groups) {

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

            $condition = ['or'];

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

        ];

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

    public function operatorNom()

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

     * @return array

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

    /**

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

     * @return array

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

     *

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

    /**

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

    }

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

        return ['vtiger_users.last_name' => SORT_ASC, 'vtiger_users.first_name' => SORT_ASC, 'vtiger_groups.groupname' => SORT_ASC];

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

            ['<>', $this->getColumnName(), 0],

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

    public function operatorY(): array

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

    }

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

     *

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

        $watchdog = \Vtiger_Watchdog_Model::getInstance($this->getModuleName());

Line exceeds 120 characters; contains 124 characters
Open

                $condition = ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 0];

Line exceeds 120 characters; contains 182 characters
Open

                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 1]]];

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

        return $condition;

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

    /**

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

    }

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

     * Currently logged user.

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

     * @return array

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

     * @return array

Line exceeds 120 characters; contains 182 characters
Open

                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 0]]];

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

            } else {

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

            $this->queryGenerator->addJoin(['LEFT JOIN', 'u_#__watchdog_record', 'vtiger_crmentity.crmid = u_#__watchdog_record.record']);

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

            }

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

    public function getOrderBy($order = false): array

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

     * Is not empty operator.

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

    {

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

                $value = -1;

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

    }

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

     * Currently logged-in user groups.

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

     */

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

     */

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

            foreach (array_keys($groups)  as $idGroup) {

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

        return $condition;

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

     */

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

        return ['and',

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

     *

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

            [$this->getColumnName() => null],

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

    public function operatorWr()

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

                $condition = ['or', ['u_#__watchdog_record.record' => null], ['not', ['u_#__watchdog_record.userid' => $watchdog->get('userId'), 'u_#__watchdog_record.state' => 0]]];

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

        }

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

     * @return array

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

    }

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

    /**

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

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_groups', 'vtiger_groups.groupid = ' . $this->getColumnName()]);

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

     *

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

     * @return array

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

    public function operatorNy(): array

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

                $condition[] = [$this->getColumnName() => (new \App\Db\Query())->select(['userid'])->from(["condition_groups_{$idGroup}_" . \App\Layout::getUniqueId() => \App\PrivilegeUtil::getQueryToUsersByGroup((int) $idGroup)])];

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

     *

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

    {

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

            $this->queryGenerator->addJoin(['LEFT JOIN', 'u_#__watchdog_record', 'vtiger_crmentity.crmid = u_#__watchdog_record.record']);

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

                $condition = ['u_#__watchdog_record.state' => 1, 'u_#__watchdog_record.userid' => $watchdog->get('userId')];

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

     */

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

        if ($order && 'DESC' === strtoupper($order)) {

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

        ];

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

    }

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

     * Is empty operator.

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

        return ['or',

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

            default:

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

    /**

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

    /**

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

     *

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

            $condition = [$this->getColumnName() => (new \yii\db\Expression('0=1'))];

Line exceeds 120 characters; contains 138 characters
Open

            $this->queryGenerator->addJoin(['LEFT JOIN', 'u_#__watchdog_record', 'vtiger_crmentity.crmid = u_#__watchdog_record.record']);

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

     * Watched record not.

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

        $condition = [];

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

            if ($watchdog->isWatchingModule()) {

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

        }

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

     */

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

            ['=', $this->getColumnName(), 0],

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

        $groups = \App\Fields\Owner::getInstance($this->getModuleName())->getGroups(false, 'private');

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

     *

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

    public function operatorNwr()

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

     *

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

     */

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

                break;

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

     * @return array

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

     */

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

     * Users who belong to the same group as the currently logged in user.

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

     */

Line exceeds 120 characters; contains 124 characters
Open

                $condition = ['u_#__watchdog_record.state' => 1, 'u_#__watchdog_record.userid' => $watchdog->get('userId')];

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

        $watchdog = \Vtiger_Watchdog_Model::getInstance($this->getModuleName());

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

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_users', 'vtiger_users.id = ' . $this->getColumnName()]);

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

            return ['vtiger_users.last_name' => SORT_DESC, 'vtiger_users.first_name' => SORT_DESC, 'vtiger_groups.groupname' => SORT_DESC];

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

    /**

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

     */

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

    {

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

        } else {

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

        }

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

            }

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

            } else {

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

     *

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

    {

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

        }

Line exceeds 120 characters; contains 132 characters
Open

        return ['vtiger_users.last_name' => SORT_ASC, 'vtiger_users.first_name' => SORT_ASC, 'vtiger_groups.groupname' => SORT_ASC];

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

     * @return array

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

     * Not Currently logged user.

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

        return ['<>', $this->getColumnName(), \App\User::getCurrentUserId()];

There are no issues that match your filters.

Category
Status