HangmanPlayerOptions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Hangman\Options;
4
5
use MiniGame\Entity\MiniGameId;
6
use MiniGame\Entity\PlayerId;
7
use MiniGame\Options\AbstractPlayerOptions;
8
use MiniGame\PlayerOptions;
9
10
class HangmanPlayerOptions extends AbstractPlayerOptions implements PlayerOptions
11
{
12
    /**
13
     * @var int
14
     */
15
    private $lives;
16
17
    /**
18
     * @var string
19
     */
20
    private $externalReference;
21
22
    /**
23
     * Constructor.
24
     */
25 81
    public function __construct()
26
    {
27 81
    }
28
29
    /**
30
     * @return int
31
     */
32 66
    public function getLives()
33
    {
34 66
        return $this->lives;
35
    }
36
37
    /**
38
     * @return string
39
     */
40 66
    public function getExternalReference()
41
    {
42 66
        return $this->externalReference;
43
    }
44
45
    /**
46
     * Constructor
47
     *
48
     * @param PlayerId   $playerId
49
     * @param MiniGameId $gameId
50
     * @param string     $name
51
     * @param int        $lives
52
     * @param string     $externalReference
53
     *
54
     * @return HangmanPlayerOptions
55
     */
56 81
    public static function create(PlayerId $playerId, MiniGameId $gameId, $name, $lives, $externalReference = null)
57
    {
58 81
        $obj = new self();
59
60 81
        $obj->init($playerId, $gameId, $name);
61 81
        $obj->lives = $lives;
62 81
        $obj->externalReference = $externalReference;
63
64 81
        return $obj;
65
    }
66
}
67