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

HangmanGoodLetterProposedEvent::getAsMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

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