HangmanPlayerOptions   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 57
ccs 12
cts 12
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getExternalReference() 0 4 1
A create() 0 10 1
A __construct() 0 3 1
A getLives() 0 4 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