HangmanResultEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 44
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getPlayedLetters() 0 4 1
A getRemainingLives() 0 4 1
1
<?php
2
3
namespace Hangman\Event\Util;
4
5
use Hangman\Result\HangmanGameResult;
6
use MiniGame\Entity\MiniGameId;
7
use MiniGame\Entity\PlayerId;
8
9
abstract class HangmanResultEvent extends HangmanBasicResultEvent implements HangmanGameResult
10
{
11
    /**
12
     * @var string[]
13
     */
14
    protected $playedLetters;
15
16
    /**
17
     * @var int
18
     */
19
    protected $remainingLives;
20
21
    /**
22
     * Constructor
23
     *
24
     * @param string     $name
25
     * @param MiniGameId $gameId
26
     * @param PlayerId   $playerId
27
     * @param string[]   $playedLetters
28
     * @param int        $remainingLives
29
     */
30 69
    public function __construct($name, MiniGameId $gameId, PlayerId $playerId, array $playedLetters, $remainingLives)
31
    {
32 69
        parent::__construct($name, $gameId, $playerId);
33 69
        $this->playedLetters = $playedLetters;
34 69
        $this->remainingLives = $remainingLives;
35 69
    }
36
37
    /**
38
     * @return array
39
     */
40 30
    public function getPlayedLetters()
41
    {
42 30
        return $this->playedLetters;
43
    }
44
45
    /**
46
     * @return int
47
     */
48 33
    public function getRemainingLives()
49
    {
50 33
        return $this->remainingLives;
51
    }
52
}
53