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 — master ( af8a26...45e031 )
by Yann
14s
created

Event::has()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Knp\Rad\DomainEvent;
4
5
use Symfony\Component\EventDispatcher\Event as BaseEvent;
6
7
class Event extends BaseEvent
8
{
9
    private $eventName;
10
    private $properties;
11
    private $subject;
12
13
    public function __construct($eventName, array $properties = array())
14
    {
15
        $this->eventName = $eventName;
16
        $this->properties = $properties;
17
    }
18
19
    public function getName()
20
    {
21
        return $this->eventName;
22
    }
23
24
    public function __get($name)
25
    {
26
        if (!$this->has($name)) {
27
            throw new \RuntimeException(sprintf(
28
                'Property %s does not exist on event %s',
29
                $name,
30
                $this->eventName
31
            ));
32
        }
33
34
        return $this->properties[$name];
35
    }
36
37
    public function has($name)
38
    {
39
        return array_key_exists($name, $this->properties);
40
    }
41
42
    public function setSubject(Provider $subject)
43
    {
44
        $this->subject = $subject;
45
    }
46
47
    public function getSubject()
48
    {
49
        return $this->subject;
50
    }
51
}
52