Test Failed
Push — develop ( 6f947a...7aea1a )
by Paul
18:36
created

Toggle::buildInput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 9
rs 10
ccs 8
cts 8
cp 1
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Modules\Html\FieldElements;
4
5
class Toggle extends Checkbox
6
{
7 17
    public function required(): array
8
    {
9 17
        return [
10 17
            'type' => 'checkbox',
11 17
        ];
12
    }
13
14 2
    protected function buildInput(array $args): string
15
    {
16 2
        $input = $this->field->builder()->input($args);
17 2
        $track = $this->field->builder()->span([
18 2
            'class' => 'glsr-toggle-track',
19 2
        ]);
20 2
        return $this->field->builder()->span([
21 2
            'class' => 'glsr-toggle',
22 2
            'text' => "{$input}{$track}",
23 2
        ]);
24
    }
25
}
26