DelegateElementBuilderTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
c 1
b 0
f 0
dl 0
loc 40
ccs 9
cts 11
cp 0.8182
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A value() 0 5 1
A buildElement() 0 3 1
A satisfy() 0 5 1
A transformer() 0 5 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