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.
Completed
Push — 3.0 ( d17819...f7dde3 )
by Vermeulen
02:59
created

Subjects::notifyAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 4
c 2
b 0
f 1
nc 1
nop 1
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace BFW;
4
5
use \SplSubject;
6
use \SplObserver;
7
8
class Subjects implements SplSubject
9
{
10
    protected $observers = [];
11
    protected $action = '';
12
    protected $context = null;
13
    
14
    public function getObservers()
15
    {
16
        return $this->observers;
17
    }
18
    
19
    public function getAction()
20
    {
21
        return $this->action;
22
    }
23
    
24
    public function setAction($action)
25
    {
26
        $this->action = $action;
27
        return $this;
28
    }
29
    
30
    public function getContext()
31
    {
32
        return $this->context;
33
    }
34
    
35
    public function setContext($context)
36
    {
37
        $this->context = $context;
38
        return $this;
39
    }
40
41
    public function attach(SplObserver $observer)
42
    {
43
        $this->observers[] = $observer;
44
45
        return $this;
46
    }
47
48
    public function detach(SplObserver $observer)
49
    {
50
        $key = array_search($observer, $this->observers, true);
51
52
        if ($key !== false) {
53
            unset($this->observers[$key]);
54
        }
55
56
        return $this;
57
    }
58
59
    public function notify()
60
    {
61
        foreach ($this->observers as $observer) {
62
            $observer->update($this);
63
        }
64
65
        return $this;
66
    }
67
    
68
    public function notifyAction($action)
69
    {
70
        $this->action = $action;
71
        $this->notify();
72
        
73
        return $this;
74
    }
75
}
76