Passed
Push — master ( a90def...5de986 )
by Chris
04:49
created

AbstractCompositeSelectionField::getLabelOptions()   A

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
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace WebTheory\Saveyour\Fields;
4
5
use WebTheory\Saveyour\Concerns\IsCompositeSelectionFieldTrait;
6
use WebTheory\Saveyour\Concerns\LabelMaker;
7
use WebTheory\Saveyour\Contracts\FormFieldInterface;
8
use WebTheory\Saveyour\Elements\Label;
9
10
abstract class AbstractCompositeSelectionField extends AbstractFormField implements FormFieldInterface
11
{
12
    use LabelMaker;
13
    use IsCompositeSelectionFieldTrait;
14
15
    /**
16
     * @var array
17
     */
18
    protected $labelOptions = [];
19
20
    /**
21
     * Get the value of labelOptions
22
     *
23
     * @return array
24
     */
25
    public function getLabelOptions(): array
26
    {
27
        return $this->labelOptions;
28
    }
29
30
    /**
31
     * Set the value of labelOptions
32
     *
33
     * @param array $labelOptions
34
     *
35
     * @return self
36
     */
37
    public function setLabelOptions(array $labelOptions)
38
    {
39
        $this->labelOptions = $labelOptions;
40
41
        return $this;
42
    }
43
44
    /**
45
     *
46
     */
47
    protected function createSelectionLabel($selection): Label
48
    {
49
        return $this->createLabel($this->defineSelectionLabel($selection), $this->labelOptions);
50
    }
51
}
52