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

Notifier   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 11
c 1
b 0
f 0
dl 0
loc 34
ccs 9
cts 15
cp 0.6
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A notify() 0 6 3
A detach() 0 3 1
A attach() 0 3 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Observers\NotifyObservers\Framework;
4
5
class Notifier
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class Notifier
Loading history...
6
{
7
8
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
9
     * @var ObserverStore
10
     */
11
    private $observerStore;
0 ignored issues
show
Coding Style introduced by
Private member variable "observerStore" must be prefixed with an underscore
Loading history...
12
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
13
     * @var string
14
     */
15
    private $notifier;
0 ignored issues
show
Coding Style introduced by
Private member variable "notifier" must be prefixed with an underscore
Loading history...
16
17 306
    public function __construct(ObserverStore $observerStore, string $notifier)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
18
    {
19 306
        $this->observerStore = $observerStore;
20 306
        $this->notifier = $notifier;
21 306
    }
22
23
    public function attach($observer)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function attach()
Loading history...
24
    {
25
        $this->observerStore->attach($this->notifier, $observer);
26
    }
27
28
    public function detach($observer)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function detach()
Loading history...
29
    {
30
        $this->observerStore->detach($this->notifier, $observer);
31
    }
32
33 151
    public function notify($method, ...$params)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function notify()
Loading history...
34
    {
35 151
        foreach($this->observerStore->forNotifier($this->notifier) as $notifierClass)  {
0 ignored issues
show
Coding Style introduced by
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
36 89
            $notifier = app($notifierClass);
37 89
            if(method_exists($notifier, $method)) {
0 ignored issues
show
Coding Style introduced by
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
38 89
                $notifier->{$method}(...$params);
39
            }
40
        }
41 151
    }
42
    
43
}