Passed
Push — master ( 384f7e...43a104 )
by Vincent
04:59
created

AnyElement   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A toPhp() 0 3 1
A sanitize() 0 3 1
A toHttp() 0 3 1
1
<?php
2
3
namespace Bdf\Form\Leaf;
4
5
/**
6
 * Element which supports any type of values
7
 * This element allow to perform any type transformation from transformers on the form declaration
8
 *
9
 * Note: it's advisable to declare a custom type instead
10
 *
11
 * @template T
12
 * @extends LeafElement<T>
13
 */
14
class AnyElement extends LeafElement
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19 19
    protected function toPhp($httpValue)
20
    {
21 19
        return $httpValue;
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27 9
    protected function toHttp($phpValue)
28
    {
29 9
        return $phpValue;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 22
    protected function sanitize($rawValue)
36
    {
37 22
        return $rawValue;
38
    }
39
}
40