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 ( e6912b...498113 )
by Toby
13:04
created

PositionObserverClearCache   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 12
c 1
b 0
f 0
dl 0
loc 32
ccs 17
cts 17
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A update() 0 6 1
A delete() 0 5 1
A create() 0 4 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Observers;
4
5
use BristolSU\ControlDB\Cache\Position as PositionCache;
6
use BristolSU\ControlDB\Contracts\Models\Position as PositionModel;
7
use Illuminate\Contracts\Cache\Repository;
8
9
class PositionObserverClearCache
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class PositionObserverClearCache
Loading history...
10
{
11
12
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
13
     * @var Repository
14
     */
15
    private $cache;
0 ignored issues
show
Coding Style introduced by
Private member variable "cache" must be prefixed with an underscore
Loading history...
16
17 4
    public function __construct(Repository $cache)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
18
    {
19 4
        $this->cache = $cache;
20 4
    }
21
22 2
    public function create(PositionModel $positionModel)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function create()
Loading history...
23
    {
24 2
        $this->cache->forget(PositionCache::class . '@count');
25 2
        $this->cache->forget(PositionCache::class . '@getByDataProviderId:' . $positionModel->dataProviderId());
26 2
    }
27
28 1
    public function delete(PositionModel $position)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function delete()
Loading history...
29
    {
30 1
        $this->cache->forget(PositionCache::class . '@count');
31 1
        $this->cache->forget(PositionCache::class . '@getById:' . $position->id());
32 1
        $this->cache->forget(PositionCache::class . '@getByDataProviderId:' . $position->dataProviderId());
33 1
    }
34
35 1
    public function update(PositionModel $oldPosition, PositionModel $newPosition)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function update()
Loading history...
36
    {
37 1
        $this->cache->forget(PositionCache::class . '@count');
38 1
        $this->cache->forget(PositionCache::class . '@getById:' . $newPosition->id());
39 1
        $this->cache->forget(PositionCache::class . '@getByDataProviderId:' . $oldPosition->dataProviderId());
40 1
        $this->cache->forget(PositionCache::class . '@getByDataProviderId:' . $newPosition->dataProviderId());
41 1
    }
42
    
43
}