Completed
Push — master ( 66ec7e...c9ec0a )
by Matze
07:32
created

Event   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 3
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 45
ccs 0
cts 9
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getValue() 0 4 1
A getKey() 0 4 1
1
<?php
2
3
namespace BrainExe\Core\Stats;
4
5
use BrainExe\Core\EventDispatcher\AbstractEvent;
6
7
/**
8
 * @api
9
 */
10
class Event extends AbstractEvent
11
{
12
13
    const INCREASE = 'stats:increase';
14
    const SET      = 'stats:set';
15
16
    /**
17
     * @var string
18
     */
19
    private $key;
20
21
    /**
22
     * @var int
23
     */
24
    private $value;
25
26
    /**
27
     * @param string $eventName self::*
28
     * @param string $key
29
     * @param int $value
30
     */
31
    public function __construct(string $eventName, string $key, int $value = 1)
32
    {
33
        parent::__construct($eventName);
34
35
        $this->key   = $key;
36
        $this->value = $value;
37
    }
38
39
    /**
40
     * @return int
41
     */
42
    public function getValue() : int
43
    {
44
        return $this->value;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getKey() : string
51
    {
52
        return $this->key;
53
    }
54
}
55