MultipleStarPlayer   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 58.81%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 34
ccs 10
cts 17
cp 0.5881
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isMultiple() 0 3 1
A getParts() 0 3 1
A setParts() 0 4 1
A configureOptions() 0 8 1
A hydrateWithOptions() 0 4 1
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