HangmanBasicResultEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 42
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getGameId() 0 4 1
A getPlayerId() 0 4 1
1
<?php
2
3
namespace Hangman\Event\Util;
4
5
use League\Event\Event;
6
use MiniGame\Entity\MiniGameId;
7
use MiniGame\Entity\PlayerId;
8
use MiniGame\GameResult;
9
10
abstract class HangmanBasicResultEvent extends Event implements GameResult
11
{
12
    /**
13
     * @var MiniGameId
14
     */
15
    protected $gameId;
16
17
    /**
18
     * @var PlayerId
19
     */
20
    protected $playerId;
21
22
    /**
23
     * Constructor
24
     *
25
     * @param string     $name
26
     * @param MiniGameId $gameId
27
     * @param PlayerId   $playerId
28
     */
29 162
    public function __construct($name, MiniGameId $gameId, PlayerId $playerId = null)
30
    {
31 162
        parent::__construct($name);
32 162
        $this->gameId = $gameId;
33 162
        $this->playerId = $playerId;
34 162
    }
35
36
    /**
37
     * @return MiniGameId
38
     */
39 162
    public function getGameId()
40
    {
41 162
        return $this->gameId;
42
    }
43
44
    /**
45
     * @return PlayerId
46
     */
47 138
    public function getPlayerId()
48
    {
49 138
        return $this->playerId;
50
    }
51
}
52