AbstractGameOptions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace MiniGame\Options;
4
5
use MiniGame\GameOptions;
6
use MiniGame\PlayerOptions;
7
8
abstract class AbstractGameOptions implements GameOptions
9
{
10
    /**
11
     * @var PlayerOptions[]
12
     */
13
    protected $playerOptions;
14
15
    /**
16
     * Constructor
17
     *
18
     * @param PlayerOptions[]   $playerOptions
19
     */
20 3
    public function __construct(array $playerOptions = [])
21
    {
22 3
        $this->init($playerOptions);
23 3
    }
24
25
    /**
26
     * Init.
27
     *
28
     * @param PlayerOptions[]   $playerOptions
29
     */
30 3
    protected function init(array $playerOptions)
31
    {
32 3
        $this->playerOptions = $playerOptions;
33 3
    }
34
35
    /**
36
     * Returns the list of players
37
     *
38
     * @return PlayerOptions[]
39
     */
40 3
    public function getPlayerOptions()
41
    {
42 3
        return $this->playerOptions;
43
    }
44
}
45