FieldTypeCheckbox   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 13 1
1
<?php
2
3
namespace Itstructure\FieldWidgets;
4
5
use yii\helpers\ArrayHelper;
6
7
/**
8
 * Class FieldTypeCheckbox
9
 * Class for printing the form checkbox field.
10
 *
11
 * @package Itstructure\FieldWidgets
12
 */
13
class FieldTypeCheckbox extends FieldType
14
{
15
    /**
16
     * @return string
17
     */
18
    public function run(): string
19
    {
20
        return $this->getField()
21
            ->checkboxList(
22
                $this->getData(),
23
                ArrayHelper::merge(
24
                    [
25
                        'separator' => '<br />'
26
                    ],
27
                    $this->getOptions()
28
                )
29
            )
30
            ->label($this->getLabel());
31
    }
32
}
33