Passed
Push — master ( acf3f9...98cfe3 )
by Derek Stephen
03:04
created

Radio   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A getTag() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Del\Form\Field;
4
5
use Del\Form\Renderer\Field\RadioRender;
6
use Del\Form\Traits\CanRenderInlineTrait;
7
use Del\Form\Traits\HasOptionsTrait;
8
9
class Radio extends FieldAbstract implements ArrayValueInterface
10
{
11
    use CanRenderInlineTrait;
12
    use HasOptionsTrait;
13
14
    /**
15
     * We end up ignoring this during rendering Radios, see the renderer for info
16
     *
17
     * @return string
18
     */
19 9
    public function getTag(): string
20
    {
21 9
        return 'div';
22
    }
23
24 12
    public function init(): void
25
    {
26 12
        $this->setRenderInline(false);
27 12
        $this->setRenderer(new RadioRender());
28
    }
29
}