MultipleStarPlayer::isMultiple()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
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