HangmanGameLostEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
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
use MiniGame\Result\AllPlayersResult;
9
use MiniGame\Result\GameLost;
10
11
class HangmanGameLostEvent extends HangmanBasicResultEvent implements AllPlayersResult, GameLost
12
{
13
    /**
14
     * @var string
15
     */
16
    const NAME = 'hangman.lost';
17
18
    /**
19
     * @var string
20
     */
21
    private $word;
22
23
    /**
24
     * Constructor
25
     *
26
     * @param MiniGameId $gameId
27
     * @param PlayerId   $playerId
28
     * @param string     $word
29
     */
30 6
    public function __construct(MiniGameId $gameId, PlayerId $playerId, $word)
31
    {
32 6
        parent::__construct(self::NAME, $gameId, $playerId);
33 6
        $this->word = $word;
34 6
    }
35
36
    /**
37
     * @return string
38
     */
39 3
    public function getWord()
40
    {
41 3
        return $this->word;
42
    }
43
44
    /**
45
     * @return string
46
     */
47 3
    public function getSolution()
48
    {
49 3
        return $this->word;
50
    }
51
}
52