GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (4568)

src/Observers/GroupObserverCascadeDelete.php (19 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Observers;
4
5
use BristolSU\ControlDB\Cache\Pivots\Tags\GroupGroupTag;
6
use BristolSU\ControlDB\Contracts\Models\Group;
7
use BristolSU\ControlDB\Contracts\Repositories\Pivots\UserGroup;
8
use BristolSU\ControlDB\Contracts\Repositories\Role;
9
10
class GroupObserverCascadeDelete
0 ignored issues
show
Missing doc comment for class GroupObserverCascadeDelete
Loading history...
11
{
12
13
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
14
     * @var UserGroup
15
     */
16
    private $userGroup;
0 ignored issues
show
Private member variable "userGroup" must be prefixed with an underscore
Loading history...
17
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
18
     * @var Role
19
     */
20
    private $role;
0 ignored issues
show
Private member variable "role" must be prefixed with an underscore
Loading history...
21
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
22
     * @var GroupGroupTag
23
     */
24
    private $groupGroupTag;
0 ignored issues
show
Private member variable "groupGroupTag" must be prefixed with an underscore
Loading history...
25
26 4
    public function __construct(UserGroup $userGroup, GroupGroupTag $groupGroupTag, Role $role)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
27
    {
28 4
        $this->userGroup = $userGroup;
29 4
        $this->role = $role;
30 4
        $this->groupGroupTag = $groupGroupTag;
31 4
    }
32
33 1
    public function delete(Group $group)
0 ignored issues
show
Missing doc comment for function delete()
Loading history...
34
    {
35 1
        $this->removeUsers($group);
36 1
        $this->removeTags($group);
37 1
        $this->deleteRoles($group);
38 1
    }
39
40 1
    private function removeUsers(Group $group)
0 ignored issues
show
Private method name "GroupObserverCascadeDelete::removeUsers" must be prefixed with an underscore
Loading history...
Missing doc comment for function removeUsers()
Loading history...
41
    {
42 1
        foreach($this->userGroup->getUsersThroughGroup($group) as $user) {
0 ignored issues
show
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
43
            $this->userGroup->removeUserFromGroup($user, $group);
44
        }
45 1
    }
46
47 1
    private function removeTags(Group $group)
0 ignored issues
show
Private method name "GroupObserverCascadeDelete::removeTags" must be prefixed with an underscore
Loading history...
Missing doc comment for function removeTags()
Loading history...
48
    {
49 1
        foreach($this->groupGroupTag->getTagsThroughGroup($group) as $tag) {
0 ignored issues
show
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
50
            $this->groupGroupTag->removeTagFromGroup($tag, $group);
51
        }
52 1
    }
53
54 1
    private function deleteRoles(Group $group)
0 ignored issues
show
Private method name "GroupObserverCascadeDelete::deleteRoles" must be prefixed with an underscore
Loading history...
Missing doc comment for function deleteRoles()
Loading history...
55
    {
56 1
        foreach($this->role->allThroughGroup($group) as $role) {
0 ignored issues
show
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
57
            $this->role->delete($role->id());
58
        }
59 1
    }
60
61
}