HangmanGoodLetterProposedEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 64
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getLetter() 0 4 1
A getWordSoFar() 0 4 1
A getFeedBack() 0 4 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
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 21
    public function __construct(
38
        MiniGameId $gameId,
39
        PlayerId $playerId,
40
        $letter,
41
        array $playedLetters,
42
        $remainingLives,
43
        $wordSoFar
44
    ) {
45 21
        parent::__construct(self::NAME, $gameId, $playerId, $playedLetters, $remainingLives);
46 21
        $this->letter = $letter;
47 21
        $this->wordSoFar = $wordSoFar;
48 21
    }
49
50
    /**
51
     * @return string
52
     */
53 18
    public function getLetter()
54
    {
55 18
        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