DelegateElementBuilderTrait::satisfy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
namespace Bdf\Form\Util;
4
5
use Bdf\Form\ElementInterface;
6
7
/**
8
 * Simple implementation of delegated element builder
9
 *
10
 * @psalm-require-implements \Bdf\Form\ElementBuilderInterface
11
 */
12
trait DelegateElementBuilderTrait
13
{
14
    use MagicCallForwarding;
15
16
    /**
17
     * {@inheritdoc}
18
     */
19 2
    final public function satisfy($constraint, $options = null, bool $append = true)
20
    {
21 2
        $this->getElementBuilder()->satisfy($constraint, $options, $append);
22
23 2
        return $this;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 2
    final public function transformer($transformer, bool $append = true)
30
    {
31 2
        $this->getElementBuilder()->transformer($transformer, $append);
32
33 2
        return $this;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39 2
    final public function value($value)
40
    {
41 2
        $this->getElementBuilder()->value($value);
42
43 2
        return $this;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    final public function buildElement(): ElementInterface
50
    {
51
        return $this->getElementBuilder()->buildElement();
52
    }
53
}
54