HangmanResultEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 5
crap 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