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

LabelTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A label() 0 14 3
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