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   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 5
Bugs 0 Features 3
Metric Value
c 5
b 0
f 3
dl 0
loc 68
rs 10
wmc 11
lcom 1
cbo 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getObservers() 0 4 1
A getAction() 0 4 1
A setAction() 0 5 1
A getContext() 0 4 1
A setContext() 0 5 1
A attach() 0 6 1
A detach() 0 10 2
A notify() 0 8 2
A notifyAction() 0 7 1
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