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/Traits/GroupTrait.php (25 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Traits;
4
5
use BristolSU\ControlDB\Contracts\Models\DataGroup;
6
use BristolSU\ControlDB\Contracts\Repositories\Group;
7
use BristolSU\ControlDB\Contracts\Repositories\Pivots\Tags\GroupGroupTag;
8
use BristolSU\ControlDB\Contracts\Repositories\Pivots\UserGroup;
9
use BristolSU\ControlDB\Contracts\Repositories\Role;
10
use Illuminate\Support\Collection;
11
12
/**
13
 * Implements common methods using repositories required by the group model interface
14
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
15
trait GroupTrait
16
{
17
18
    /**
19
     * Get the data group for this group
20
     * 
21
     * @return DataGroup
22
     */
23 13
    public function data(): DataGroup
24
    {
25 13
        return app(\BristolSU\ControlDB\Contracts\Repositories\DataGroup::class)->getById($this->dataProviderId());
0 ignored issues
show
It seems like dataProviderId() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        return app(\BristolSU\ControlDB\Contracts\Repositories\DataGroup::class)->getById($this->/** @scrutinizer ignore-call */ dataProviderId());
Loading history...
26
    }
27
28
    /**
29
     * Set the ID of the data provider
30
     *
31
     * @param int $dataProviderId
0 ignored issues
show
Missing parameter comment
Loading history...
32
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
33 2
    public function setDataProviderId(int $dataProviderId): void
34
    {
35 2
        app(Group::class)->update($this->id(), $dataProviderId);
0 ignored issues
show
It seems like id() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

35
        app(Group::class)->update($this->/** @scrutinizer ignore-call */ id(), $dataProviderId);
Loading history...
36 2
    }
37
38
    /**
39
     * Members of the group
40
     *
41
     * @return Collection
42
     */
43 2
    public function members(): Collection
44
    {
45 2
        return app(UserGroup::class)->getUsersThroughGroup($this);
0 ignored issues
show
$this of type BristolSU\ControlDB\Traits\GroupTrait is incompatible with the type BristolSU\ControlDB\Contracts\Models\Group expected by parameter $group of BristolSU\ControlDB\Cont...:getUsersThroughGroup(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

45
        return app(UserGroup::class)->getUsersThroughGroup(/** @scrutinizer ignore-type */ $this);
Loading history...
46
    }
47
48
    /**
49
     * Roles belonging to the group
50
     *
51
     * @return Collection
52
     */
53 3
    public function roles(): Collection
54
    {
55 3
        return app(Role::class)->allThroughGroup($this);
0 ignored issues
show
$this of type BristolSU\ControlDB\Traits\GroupTrait is incompatible with the type BristolSU\ControlDB\Contracts\Models\Group expected by parameter $group of BristolSU\ControlDB\Cont...Role::allThroughGroup(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

55
        return app(Role::class)->allThroughGroup(/** @scrutinizer ignore-type */ $this);
Loading history...
56
    }
57
58
    /**
59
     * Tags the group is tagged with
60
     *
61
     * @return Collection
62
     */
63 2
    public function tags(): Collection
64
    {
65 2
        return app(GroupGroupTag::class)->getTagsThroughGroup($this);
0 ignored issues
show
$this of type BristolSU\ControlDB\Traits\GroupTrait is incompatible with the type BristolSU\ControlDB\Contracts\Models\Group expected by parameter $group of BristolSU\ControlDB\Cont...::getTagsThroughGroup(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

65
        return app(GroupGroupTag::class)->getTagsThroughGroup(/** @scrutinizer ignore-type */ $this);
Loading history...
66
    }
67
68
    /**
69
     * Add a tag to the group
70
     * 
71
     * @param \BristolSU\ControlDB\Contracts\Models\Tags\GroupTag $groupTag
0 ignored issues
show
Missing parameter comment
Loading history...
72
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
73 6
    public function addTag(\BristolSU\ControlDB\Contracts\Models\Tags\GroupTag $groupTag): void
74
    {
75 6
        app(GroupGroupTag::class)->addTagToGroup($groupTag, $this);
0 ignored issues
show
$this of type BristolSU\ControlDB\Traits\GroupTrait is incompatible with the type BristolSU\ControlDB\Contracts\Models\Group expected by parameter $group of BristolSU\ControlDB\Cont...oupTag::addTagToGroup(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

75
        app(GroupGroupTag::class)->addTagToGroup($groupTag, /** @scrutinizer ignore-type */ $this);
Loading history...
76 6
    }
77
78
    /**
79
     * Remove a tag from the group
80
     * 
81
     * @param \BristolSU\ControlDB\Contracts\Models\Tags\GroupTag $groupTag
0 ignored issues
show
Missing parameter comment
Loading history...
82
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
83 2
    public function removeTag(\BristolSU\ControlDB\Contracts\Models\Tags\GroupTag $groupTag): void
84
    {
85 2
        app(GroupGroupTag::class)->removeTagFromGroup($groupTag, $this);
0 ignored issues
show
$this of type BristolSU\ControlDB\Traits\GroupTrait is incompatible with the type BristolSU\ControlDB\Contracts\Models\Group expected by parameter $group of BristolSU\ControlDB\Cont...g::removeTagFromGroup(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

85
        app(GroupGroupTag::class)->removeTagFromGroup($groupTag, /** @scrutinizer ignore-type */ $this);
Loading history...
86 2
    }
87
88
    /**
89
     * Add a user to the group
90
     * 
91
     * @param \BristolSU\ControlDB\Contracts\Models\User $user
0 ignored issues
show
Missing parameter comment
Loading history...
92
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
93 5
    public function addUser(\BristolSU\ControlDB\Contracts\Models\User $user): void
94
    {
95 5
        app(UserGroup::class)->addUserToGroup($user, $this);
0 ignored issues
show
$this of type BristolSU\ControlDB\Traits\GroupTrait is incompatible with the type BristolSU\ControlDB\Contracts\Models\Group expected by parameter $group of BristolSU\ControlDB\Cont...Group::addUserToGroup(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

95
        app(UserGroup::class)->addUserToGroup($user, /** @scrutinizer ignore-type */ $this);
Loading history...
96
97 5
    }
98
99
    /**
100
     * Remove a user from the group
101
     * 
102
     * @param \BristolSU\ControlDB\Contracts\Models\User $user
0 ignored issues
show
Missing parameter comment
Loading history...
103
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
104 2
    public function removeUser(\BristolSU\ControlDB\Contracts\Models\User $user): void
105
    {
106 2
        app(UserGroup::class)->removeUserFromGroup($user, $this);
0 ignored issues
show
$this of type BristolSU\ControlDB\Traits\GroupTrait is incompatible with the type BristolSU\ControlDB\Contracts\Models\Group expected by parameter $group of BristolSU\ControlDB\Cont...::removeUserFromGroup(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

106
        app(UserGroup::class)->removeUserFromGroup($user, /** @scrutinizer ignore-type */ $this);
Loading history...
107 2
    }
108
109
110
}