HangmanBadLetterProposedEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 7
crap 1
1
<?php
2
3
namespace Hangman\Event;
4
5
use Hangman\Event\Util\HangmanResultEvent;
6
use Hangman\Result\HangmanBadProposition;
7
use MiniGame\Entity\MiniGameId;
8
use MiniGame\Entity\PlayerId;
9
10
class HangmanBadLetterProposedEvent extends HangmanResultEvent implements HangmanBadProposition
11
{
12
    /**
13
     * @var string
14
     */
15
    const NAME = 'hangman.letter.bad';
16
17
    /**
18
     * @var string
19
     */
20
    private $letter;
21
22
    /**
23
     * @var int
24
     */
25
    private $livesLost;
26
27
    /**
28
     * @var string
29
     */
30
    private $wordSoFar;
31
32
    /**
33
     * Constructor
34
     *
35
     * @param MiniGameId $gameId
36
     * @param PlayerId   $playerId
37
     * @param string     $letter
38
     * @param array      $playedLetters
39
     * @param int        $livesLost
40
     * @param int        $remainingLives
41
     * @param string     $wordSoFar
42
     */
43 21
    public function __construct(
44
        MiniGameId $gameId,
45
        PlayerId $playerId,
46
        $letter,
47
        array $playedLetters,
48
        $livesLost,
49
        $remainingLives,
50
        $wordSoFar
51
    ) {
52 21
        parent::__construct(self::NAME, $gameId, $playerId, $playedLetters, $remainingLives);
53 21
        $this->letter = $letter;
54 21
        $this->livesLost = $livesLost;
55 21
        $this->wordSoFar = $wordSoFar;
56 21
    }
57
58
    /**
59
     * @return string
60
     */
61 18
    public function getLetter()
62
    {
63 18
        return $this->letter;
64
    }
65
66
    /**
67
     * @return int
68
     */
69 18
    public function getLivesLost()
70
    {
71 18
        return $this->livesLost;
72
    }
73
74
    /**
75
     * @return string
76
     */
77 3
    public function getWordSoFar()
78
    {
79 3
        return $this->wordSoFar;
80
    }
81
82
    /**
83
     * @return string
84
     */
85 6
    public function getFeedback()
86
    {
87 6
        return $this->wordSoFar;
88
    }
89
}
90