rhosocial/yii2-base-models

View on GitHub
queries/BaseMongoMessageQuery.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\rhosocial\base\models\models\BaseMongoEntityModel' in method 'opposite'.
Open

            [$model->createdByAttribute => BaseMongoEntityModel::compositeGUIDs($other),
Severity: Minor
Found in queries/BaseMongoMessageQuery.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\BaseMongoEntityModel' in method 'recipients'.
Open

        return $this->andWhere([$model->otherGuidAttribute => BaseMongoEntityModel::compositeGUIDs($users)]);
Severity: Minor
Found in queries/BaseMongoMessageQuery.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\BaseMongoEntityModel' in method 'opposite'.
Open

        $model->otherGuidAttribute => BaseMongoEntityModel::compositeGUIDs($user)])->orderByCreatedAt(SORT_DESC)
Severity: Minor
Found in queries/BaseMongoMessageQuery.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\BaseMongoEntityModel' in method 'opposites'.
Open

        $query = $this->andWhere([$model->otherGuidAttribute => BaseMongoEntityModel::compositeGUIDs($user)]);
Severity: Minor
Found in queries/BaseMongoMessageQuery.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\BaseMongoEntityModel' in method 'opposites'.
Open

            $query = $query->andWhere([$model->createdByAttribute => BaseMongoEntityModel::compositeGUIDs($others)]);
Severity: Minor
Found in queries/BaseMongoMessageQuery.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\BaseMongoEntityModel' in method 'initiators'.
Open

        return $this->andWhere([$model->createdByAttribute => BaseMongoEntityModel::compositeGUIDs($users)]);
Severity: Minor
Found in queries/BaseMongoMessageQuery.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

Expected 1 newline at end of file; 0 found
Open

}

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

        $model->otherGuidAttribute => BaseMongoEntityModel::compositeGUIDs($user)])->orderByCreatedAt(SORT_DESC)

There are no issues that match your filters.

Category
Status