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

AnyElement::toPhp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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