Completed
Push — master ( bafc2b...789f6f )
by Oscar
03:26
created

LabelTrait::label()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 3
eloc 7
nc 3
nop 1
1
<?php
2
3
namespace Folk\Formats\Traits;
4
5
use FormManager\Elements\Label;
6
7
trait LabelTrait
8
{
9
    protected $label;
10
11
    public function label($label = null)
12
    {
13
        if ($label === null) {
14
            return $this->label;
15
        }
16
17
        if (empty($this->label)) {
18
            $this->label = new Label();
19
        }
20
21
        $this->label->html($label);
22
23
        return $this;
24
    }
25
}
26