HangmanPlayerCreatedEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPlayerName() 0 4 1
A getLives() 0 4 1
A getExternalReference() 0 4 1
A __construct() 0 7 1
1
<?php
2
3
namespace Hangman\Event;
4
5
use Hangman\Event\Util\HangmanBasicResultEvent;
6
use MiniGame\Entity\MiniGameId;
7
use MiniGame\Entity\PlayerId;
8
use MiniGame\Event\PlayerCreatedEvent;
9
10
class HangmanPlayerCreatedEvent extends HangmanBasicResultEvent implements PlayerCreatedEvent
11
{
12
    /**
13
     * @var string
14
     */
15
    const NAME = 'hangman.player.created';
16
17
    /**
18
     * @var string
19
     */
20
    private $playerName;
21
22
    /**
23
     * @var int
24
     */
25
    private $lives;
26
27
    /**
28
     * @var string
29
     */
30
    private $externalReference;
31
32
    /**
33
     * Constructor
34
     *
35
     * @param MiniGameId $gameId
36
     * @param PlayerId   $playerId
37
     * @param string     $playerName
38
     * @param int        $lives
39
     * @param string     $externalReference
40
     */
41 66
    public function __construct(MiniGameId $gameId, PlayerId $playerId, $playerName, $lives, $externalReference)
42
    {
43 66
        parent::__construct(self::NAME, $gameId, $playerId);
44 66
        $this->playerName = $playerName;
45 66
        $this->lives = $lives;
46 66
        $this->externalReference = $externalReference;
47 66
    }
48
49
    /**
50
     * @return string
51
     */
52 66
    public function getPlayerName()
53
    {
54 66
        return $this->playerName;
55
    }
56
57
    /**
58
     * @return int
59
     */
60 66
    public function getLives()
61
    {
62 66
        return $this->lives;
63
    }
64
65
    /**
66
     * @return string
67
     */
68 66
    public function getExternalReference()
69
    {
70 66
        return $this->externalReference;
71
    }
72
}
73