MultipleStarPlayer::hydrateWithOptions()   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
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Obblm\Core\Helper\Rule\Inducement;
4
5
use Obblm\Core\Contracts\InducementInterface;
6
use Symfony\Component\OptionsResolver\OptionsResolver;
7
8
class MultipleStarPlayer extends StarPlayer implements InducementInterface
9
{
10
    protected $parts = [];
11
12 1
    protected function hydrateWithOptions()
13
    {
14 1
        parent::hydrateWithOptions();
15 1
        $this->parts = $this->options['parts'];
16 1
    }
17
18
    public function isMultiple(): bool
19
    {
20
        return true;
21
    }
22
23
    public function setParts(array $parts):self
24
    {
25
        $this->parts = $parts;
26
        return $this;
27
    }
28
29
    public function getParts():array
30
    {
31
        return $this->parts;
32
    }
33
34 1
    public function configureOptions(OptionsResolver $resolver):void
35
    {
36 1
        parent::configureOptions($resolver);
37 1
        $resolver->setDefaults([
38 1
            'parts' => null,
39
        ])
40 1
            ->setRequired(['parts'])
41 1
            ->setAllowedTypes('parts', ['array'])
42
        ;
43 1
    }
44
}
45