Radio::onEdit()   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 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