rhosocial/yii2-base-models

View on GitHub
traits/MutualQueryTrait.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\rhosocial\base\models\models\BaseUserModel' in method 'recipients'.
Open

        return $this->andWhere([$model->otherGuidAttribute => BaseUserModel::compositeGUIDs($users)]);
Severity: Minor
Found in traits/MutualQueryTrait.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 '\rhosocial\base\models\models\BaseUserModel' in method 'opposites'.
Open

        $query = $this->andWhere([$model->otherGuidAttribute => BaseUserModel::compositeGUIDs($user)]);
Severity: Minor
Found in traits/MutualQueryTrait.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 '\rhosocial\base\models\models\BaseUserModel' in method 'opposite'.
Open

            [$model->createdByAttribute => BaseUserModel::compositeGUIDs($other),
Severity: Minor
Found in traits/MutualQueryTrait.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 '\rhosocial\base\models\models\BaseUserModel' in method 'initiators'.
Open

        return $this->andWhere([$model->createdByAttribute => BaseUserModel::compositeGUIDs($users)]);
Severity: Minor
Found in traits/MutualQueryTrait.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 '\rhosocial\base\models\models\BaseUserModel' in method 'opposites'.
Open

            $query = $query->andWhere([$model->createdByAttribute => BaseUserModel::compositeGUIDs($others)]);
Severity: Minor
Found in traits/MutualQueryTrait.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 '\rhosocial\base\models\models\BaseUserModel' in method 'opposite'.
Open

        $model->otherGuidAttribute => BaseUserModel::compositeGUIDs($user)])->one($database);
Severity: Minor
Found in traits/MutualQueryTrait.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

Scope keyword "static" must be followed by a single space
Open

    public function initiators($users = []): static
Severity: Minor
Found in traits/MutualQueryTrait.php by phpcodesniffer

Scope keyword "static" must be followed by a single space
Open

    public function recipients($users = []): static
Severity: Minor
Found in traits/MutualQueryTrait.php by phpcodesniffer

Closing parenthesis of a multi-line function call must be on a line by itself
Open

        $model->otherGuidAttribute => BaseUserModel::compositeGUIDs($user)])->one($database);
Severity: Minor
Found in traits/MutualQueryTrait.php by phpcodesniffer

There are no issues that match your filters.

Category
Status