HangmanPlayerLostEvent   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 getWordFound() 0 4 1
A getWord() 0 4 1
A getSolution() 0 4 1
1
<?php
2
3
namespace Hangman\Event;
4
5
use Hangman\Event\Util\HangmanResultEvent;
6
use Hangman\Result\HangmanLost;
7
use MiniGame\Entity\MiniGameId;
8
use MiniGame\Entity\PlayerId;
9
10
class HangmanPlayerLostEvent extends HangmanResultEvent implements HangmanLost
11
{
12
    /**
13
     * @var string
14
     */
15
    const NAME = 'hangman.player.lost';
16
17
    /**
18
     * @var string
19
     */
20
    private $wordFound;
21
22
    /**
23
     * @var string
24
     */
25
    private $word;
26
27
    /**
28
     * Constructor
29
     *
30
     * @param MiniGameId $gameId
31
     * @param PlayerId   $playerId
32
     * @param array      $playedLetters
33
     * @param int        $remainingLives
34
     * @param string     $wordFound
35
     * @param string     $word
36
     */
37 30
    public function __construct(
38
        MiniGameId $gameId,
39
        PlayerId $playerId,
40
        array $playedLetters,
41
        $remainingLives,
42
        $wordFound,
43
        $word
44
    ) {
45 30
        parent::__construct(self::NAME, $gameId, $playerId, $playedLetters, $remainingLives);
46 30
        $this->wordFound = $wordFound;
47 30
        $this->word = $word;
48 30
    }
49
50
    /**
51
     * @return string
52
     */
53 3
    public function getWordFound()
54
    {
55 3
        return $this->wordFound;
56
    }
57
58
    /**
59
     * @return string
60
     */
61 3
    public function getWord()
62
    {
63 3
        return $this->word;
64
    }
65
66
    /**
67
     * @return string
68
     */
69 6
    public function getSolution()
70
    {
71 6
        return $this->word;
72
    }
73
}
74