MiniGameAppErrorEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 58
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getGameId() 0 4 1
A getPlayerId() 0 4 1
A getAsMessage() 0 4 1
1
<?php
2
3
namespace MiniGameApp\Event;
4
5
use League\Event\Event;
6
use MiniGame\Entity\MiniGameId;
7
use MiniGame\Entity\PlayerId;
8
use MiniGame\GameResult;
9
10
class MiniGameAppErrorEvent extends Event implements GameResult
11
{
12
    const NAME = 'minigame.error';
13
14
    /**
15
     * @var MiniGameId
16
     */
17
    private $gameId;
18
19
    /**
20
     * @var PlayerId
21
     */
22
    private $playerId;
23
24
    /**
25
     * @var string
26
     */
27
    private $message;
28
29
    /**
30
     * Constructor
31
     *
32
     * @param MiniGameId $gameId
33
     * @param PlayerId   $playerId
34
     * @param string     $message
35
     */
36 21
    public function __construct(MiniGameId $gameId, PlayerId $playerId, $message)
37
    {
38 21
        parent::__construct(static::NAME);
39 21
        $this->gameId = $gameId;
40 21
        $this->playerId = $playerId;
41 21
        $this->message = $message;
42 21
    }
43
44
    /**
45
     * @return MiniGameId
46
     */
47 3
    public function getGameId()
48
    {
49 3
        return $this->gameId;
50
    }
51
52
    /**
53
     * @return PlayerId
54
     */
55 3
    public function getPlayerId()
56
    {
57 3
        return $this->playerId;
58
    }
59
60
    /**
61
     * @return string
62
     */
63 3
    public function getAsMessage()
64
    {
65 3
        return $this->message;
66
    }
67
}
68