rhopress/yii2-rhopress

View on GitHub
models/Comment.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class 'rhopress\models\Article' in method 'getArticle'.
Open

        return $this->hasOne(Article::className(), [$article->guidAttribute => 'article_guid']);
Severity: Minor
Found in models/Comment.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 '\rhopress\Module' in method 'attributeLabels'.
Open

            'create_time' => Module::t('models', 'Created At'),
Severity: Minor
Found in models/Comment.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 '\rhopress\Module' in method 'attributeLabels'.
Open

            'update_time' => Module::t('models', 'Last Updated At'),
Severity: Minor
Found in models/Comment.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 '\rhopress\Module' in method 'attributeLabels'.
Open

            'content' => Module::t('models', 'Content'),
Severity: Minor
Found in models/Comment.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 'rhopress\models\CommentQuery' in method 'init'.
Open

        $this->queryClass = CommentQuery::className();
Severity: Minor
Found in models/Comment.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 'rhopress\models\Article' in method 'getArticle'.
Open

        $article = Article::buildNoInitModel();
Severity: Minor
Found in models/Comment.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

Opening brace should be on a new line
Open

    public static function find() {
Severity: Minor
Found in models/Comment.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in models/Comment.php by phpcodesniffer

There are no issues that match your filters.

Category
Status