Completed
Push — master ( ef0d72...64275d )
by Rémi
02:45
created

HangmanPlayerCreatedEvent::getAsMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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
9
class HangmanPlayerCreatedEvent extends HangmanBasicResultEvent
0 ignored issues
show
Bug introduced by
There is one abstract method getAsMessage in this class; you could implement it, or declare this class as abstract.
Loading history...
10
{
11
    /**
12
     * @var string
13
     */
14
    const NAME = 'hangman.player.created';
15
16
    /**
17
     * @var string
18
     */
19
    private $playerName;
20
21
    /**
22
     * @var int
23
     */
24
    private $lives;
25
26
    /**
27
     * @var string
28
     */
29
    private $externalReference;
30
31
    /**
32
     * Constructor
33
     *
34
     * @param MiniGameId $gameId
35
     * @param PlayerId   $playerId
36
     * @param string     $playerName
37
     * @param int        $lives
38
     * @param string     $externalReference
39
     */
40 78
    public function __construct(MiniGameId $gameId, PlayerId $playerId, $playerName, $lives, $externalReference)
41
    {
42 78
        parent::__construct(self::NAME, $gameId, $playerId);
43 78
        $this->playerName = $playerName;
44 78
        $this->lives = $lives;
45 78
        $this->externalReference = $externalReference;
46 78
    }
47
48
    /**
49
     * @return string
50
     */
51 78
    public function getPlayerName()
52
    {
53 78
        return $this->playerName;
54
    }
55
56
    /**
57
     * @return int
58
     */
59 78
    public function getLives()
60
    {
61 78
        return $this->lives;
62
    }
63
64
    /**
65
     * @return string
66
     */
67 3
    public function getExternalReference()
68
    {
69 3
        return $this->externalReference;
70
    }
71
}
72