Completed
Push — master ( 670c0a...062b68 )
by Terzi
04:34
created

Radio   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 50
rs 10
c 0
b 0
f 0

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 Generic
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
     * @return self
23
     */
24
    public function setOptions(array $options): self
25
    {
26
        $this->options = $options;
27
28
        return $this;
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    public function onIndex()
35
    {
36
        return [
37
            'options' => $this->getOptions(),
38
        ];
39
    }
40
41
    /**
42
     * @return array
43
     */
44
    public function onView()
45
    {
46
        return $this->onIndex();
47
    }
48
49
    /**
50
     * @return array
51
     */
52
    public function onEdit()
53
    {
54
        return $this->onIndex();
55
    }
56
}