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

Notifier::notify()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
cc 3
nc 3
nop 2
crap 3
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 317
    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 317
        $this->observerStore = $observerStore;
20 317
        $this->notifier = $notifier;
21 317
    }
22
23 1
    public function attach($observer)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function attach()
Loading history...
24
    {
25 1
        $this->observerStore->attach($this->notifier, $observer);
26 1
    }
27
28 1
    public function detach($observer)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function detach()
Loading history...
29
    {
30 1
        $this->observerStore->detach($this->notifier, $observer);
31 1
    }
32
33 152
    public function notify($method, ...$params)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function notify()
Loading history...
34
    {
35 152
        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 152
            $notifier = app($notifierClass);
37 152
            if(method_exists($notifier, $method)) {
0 ignored issues
show
Coding Style introduced by
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
38 141
                $notifier->{$method}(...$params);
39
            }
40
        }
41 152
    }
42
    
43
}