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

HangmanPlayerCreatedEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getPlayerName() 0 4 1
A getLives() 0 4 1
A getExternalReference() 0 4 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