Completed
Push — master ( 5052b0...8431a9 )
by Gabriel
04:18
created

HasElementTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 26
c 0
b 0
f 0
ccs 3
cts 5
cp 0.6
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setElement() 0 6 1
A getElement() 0 4 1
1
<?php
2
3
namespace Nip\Form\Decorator\Elements\Traits;
4
5
use Nip\Form\Elements\AbstractElement;
6
use Nip\Form\Elements\Traits\HasDecoratorsTrait;
7
8
/**
9
 * Trait HasElementTrait
10
 * @package Nip\Form\Decorator\Elements
11
 */
12
trait HasElementTrait
13
{
14
    /**
15
     * @var AbstractElement
16
     */
17
    protected $element;
18
19
    /**
20
     * @param AbstractElement|HasDecoratorsTrait $element
21
     * @return $this
22
     */
23 1
    public function setElement(AbstractElement $element)
24
    {
25 1
        $this->element = $element;
26
27 1
        return $this;
28
    }
29
30
    /**
31
     * @return AbstractElement
32
     */
33
    public function getElement()
34
    {
35
        return $this->element;
36
    }
37
}
38