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

AbstractSimpleField   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A generateHint() 0 3 1
A generateError() 0 3 1
A generateLabel() 0 3 1
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