src/Acl/Policies/SquadPolicy.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$squad'.
Open

    public function manage_roles(User $user, Squad $squad)
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.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 '$ability'.
Open

    public function before(User $user, string $ability)
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.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 '$squad'.
Open

    public function delete(User $user, Squad $squad)
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.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 '$squad'.
Open

    public function manage_moderators(User $user, Squad $squad)
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.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

The method manage_roles is not named in camelCase.
Open

    public function manage_roles(User $user, Squad $squad)
    {
        return $user->isAdmin();
    }
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method manage_moderators is not named in camelCase.
Open

    public function manage_moderators(User $user, Squad $squad)
    {
        return $user->isAdmin();
    }
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method manage_candidates is not named in camelCase.
Open

    public function manage_candidates(User $user, Squad $squad)
    {
        return $squad->type == 'manual' && $squad->moderators->where('id', $user->id)->isNotEmpty();
    }
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method show_members is not named in camelCase.
Open

    public function show_members(User $user, Squad $squad)
    {
        return ($squad->members->where('id', $user->id)->isNotEmpty() &&
            ! $squad->is_classified) ||
            $squad->moderators->where('id', $user->id)->isNotEmpty();
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method manage_members is not named in camelCase.
Open

    public function manage_members(User $user, Squad $squad)
    {
        return $squad->moderators->where('id', $user->id)->isNotEmpty();
    }
Severity: Minor
Found in src/Acl/Policies/SquadPolicy.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status