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/Cache/Pivots/UserGroup.php (24 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Cache\Pivots;
4
5
use BristolSU\ControlDB\Contracts\Models\Group;
6
use BristolSU\ControlDB\Contracts\Models\User;
7
use BristolSU\ControlDB\Contracts\Repositories\Pivots\UserGroup as UserGroupContract;
8
use Illuminate\Contracts\Cache\Repository;
9
use Illuminate\Support\Collection;
10
11
class UserGroup implements UserGroupContract
0 ignored issues
show
Missing doc comment for class UserGroup
Loading history...
12
{
13
14
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
15
     * @var UserGroupContract
16
     */
17
    private $userGroup;
0 ignored issues
show
Private member variable "userGroup" must be prefixed with an underscore
Loading history...
18
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
19
     * @var Repository
20
     */
21
    private $cache;
0 ignored issues
show
Private member variable "cache" must be prefixed with an underscore
Loading history...
22
23 25
    public function __construct(UserGroupContract $userGroup, Repository $cache)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
24
    {
25 25
        $this->userGroup = $userGroup;
26 25
        $this->cache = $cache;
27 25
    }
28
29
    /**
30
     * Get all users who are members of a group
31
     *
32
     * @param Group $group
0 ignored issues
show
Missing parameter comment
Loading history...
33
     * @return User[]|Collection Users who are members of the group
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
34
     */
35 4
    public function getUsersThroughGroup(Group $group): Collection
36
    {
37
        return $this->cache->rememberForever(static::class . '@getUsersThroughGroup:' . $group->id(), function() use ($group) {
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
38 4
            return $this->userGroup->getUsersThroughGroup($group);
39 4
        });
0 ignored issues
show
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
40
    }
41
42
    /**
43
     * Get all groups a user belongs to
44
     *
45
     * @param User $user
0 ignored issues
show
Missing parameter comment
Loading history...
46
     * @return Group[]|Collection Groups the user is a member of
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
47
     */
48 4
    public function getGroupsThroughUser(User $user): Collection
49
    {
50
        return $this->cache->rememberForever(static::class . '@getGroupsThroughUser:' . $user->id(), function() use ($user) {
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
51 4
            return $this->userGroup->getGroupsThroughUser($user);
52 4
        });    
0 ignored issues
show
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
53
    }
54
55
    /**
56
     * Add a user to a group
57
     *
58
     * @param User $user User to add to the group
0 ignored issues
show
Expected 2 spaces after parameter type; 1 found
Loading history...
Expected 2 spaces after parameter name; 1 found
Loading history...
59
     * @param Group $group Group to add the user to
60
     * @return void
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
61
     */
62 12
    public function addUserToGroup(User $user, Group $group): void
63
    {
64 12
        $this->userGroup->addUserToGroup($user, $group);
65 12
    }
66
67
    /**
68
     * Remove a user from a group
69
     * @param User $user User to remove from the group
0 ignored issues
show
There must be exactly one blank line before the tags in a doc comment
Loading history...
Expected 2 spaces after parameter type; 1 found
Loading history...
Expected 2 spaces after parameter name; 1 found
Loading history...
70
     * @param Group $group Group to remove the user from
71
     * @return void
0 ignored issues
show
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
72
     */
73 5
    public function removeUserFromGroup(User $user, Group $group): void
74
    {
75 5
        $this->userGroup->removeUserFromGroup($user, $group);
76
    }
77
}