Radio   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 51
ccs 0
cts 11
cp 0
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A onEdit() 0 3 1
A onView() 0 3 1
A setOptions() 0 5 1
A getOptions() 0 3 1
A onIndex() 0 4 1
1
<?php
2
3
namespace Terranet\Administrator\Field;
4
5
class Radio extends Field
6
{
7
    /**
8
     * @var array
9
     */
10
    protected $options = [];
11
12
    /**
13
     * @return array
14
     */
15
    public function getOptions(): array
16
    {
17
        return (array) $this->options;
18
    }
19
20
    /**
21
     * @param array $options
22
     *
23
     * @return self
24
     */
25
    public function setOptions(array $options): self
26
    {
27
        $this->options = $options;
28
29
        return $this;
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    public function onIndex()
36
    {
37
        return [
38
            'options' => $this->getOptions(),
39
        ];
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function onView()
46
    {
47
        return $this->onIndex();
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function onEdit()
54
    {
55
        return $this->onIndex();
56
    }
57
}
58