Passed
Pull Request — master (#192)
by Alexander
06:02 queued 02:54
created

AbstractSimpleField::generateLabel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Form\Field\Base;
6
7
use Yiisoft\Form\Field\Part\Error;
8
use Yiisoft\Form\Field\Part\Hint;
9
use Yiisoft\Form\Field\Part\Label;
10
11
abstract class AbstractSimpleField extends AbstractFullField
12
{
13 20
    final protected function generateLabel(): string
14
    {
15 20
        return Label::widget($this->labelConfig)->render();
16
    }
17
18 20
    final protected function generateHint(): string
19
    {
20 20
        return Hint::widget($this->hintConfig)->render();
21
    }
22
23 20
    final protected function generateError(): string
24
    {
25 20
        return Error::widget($this->errorConfig)->render();
26
    }
27
}
28