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.
Passed
Push — develop ( 8960eb...4cfcae )
by Toby
12:56
created

UserGroupObserverClearCache::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Observers\Pivots;
4
5
use BristolSU\ControlDB\Cache\Pivots\UserGroup as UserGroupCache;
6
use BristolSU\ControlDB\Contracts\Models\Group;
7
use BristolSU\ControlDB\Contracts\Models\User;
8
use Illuminate\Contracts\Cache\Repository;
9
10
class UserGroupObserverClearCache
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class UserGroupObserverClearCache
Loading history...
11
{
12
13
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
14
     * @var Repository
15
     */
16
    private $cache;
0 ignored issues
show
Coding Style introduced by
Private member variable "cache" must be prefixed with an underscore
Loading history...
17
18 11
    public function __construct(Repository $cache)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
19
    {
20 11
        $this->cache = $cache;
21 11
    }
22
23 11
    public function addUserToGroup(User $user, Group $group)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function addUserToGroup()
Loading history...
24
    {
25 11
        $this->cache->forget(UserGroupCache::class . '@getGroupsThroughUser:' . $user->id());
26 11
        $this->cache->forget(UserGroupCache::class . '@getUsersThroughGroup:' . $group->id());
27 11
    }
28
29 4
    public function removeUserFromGroup(User $user, Group $group): void
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function removeUserFromGroup()
Loading history...
30
    {
31 4
        $this->cache->forget(UserGroupCache::class . '@getGroupsThroughUser:' . $user->id());
32 4
        $this->cache->forget(UserGroupCache::class . '@getUsersThroughGroup:' . $group->id());
33 4
    }
34
35
}