rhosocial/yii2-organization

View on GitHub
grid/AddMemberActionColumn.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\Yii' in method 'initDefaultButtons'.
Open

            'title' => Yii::t('organization', 'Add'),
Severity: Minor
Found in grid/AddMemberActionColumn.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 '\Yii' in method 'init'.
Open

            $this->header = Yii::t('user', 'Action');
Severity: Minor
Found in grid/AddMemberActionColumn.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 '\Yii' in method 'initDefaultButtons'.
Open

            'aria-label' => Yii::t('organization', 'Add'),
Severity: Minor
Found in grid/AddMemberActionColumn.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 '\yii\helpers\Url' in method 'initUrlCreator'.
Open

                return Url::to(['add-member', 'org' => $column->organization->getID(), 'u' => $model->id]);
Severity: Minor
Found in grid/AddMemberActionColumn.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 '\Yii' in method 'initDefaultButtons'.
Open

                $this->addConfirmText = Yii::t('organization', 'Are you sure to add this user to the organization / department?');
Severity: Minor
Found in grid/AddMemberActionColumn.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 unused parameters such as '$key'.
Open

        $this->urlCreator = function ($action, $model, $key, $index, AddMemberActionColumn $column) {
Severity: Minor
Found in grid/AddMemberActionColumn.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$key'.
Open

            'add' => function ($model, $key, $index) {
Severity: Minor
Found in grid/AddMemberActionColumn.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$index'.
Open

            'add' => function ($model, $key, $index) {
Severity: Minor
Found in grid/AddMemberActionColumn.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$index'.
Open

        $this->urlCreator = function ($action, $model, $key, $index, AddMemberActionColumn $column) {
Severity: Minor
Found in grid/AddMemberActionColumn.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Line exceeds 120 characters; contains 130 characters
Open

                $this->addConfirmText = Yii::t('organization', 'Are you sure to add this user to the organization / department?');

There are no issues that match your filters.

Category
Status