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

HasElementTrait::setElement()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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