Completed
Push — master ( 5c06f5...c281cd )
by Arnaud
8s
created

Boolean::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace LAG\AdminBundle\Field\Field;
4
5
class Boolean extends StringField
6
{
7
    public function render($value)
8
    {
9
        $result = filter_var($value, FILTER_VALIDATE_BOOLEAN);
10
        $text = ($result) ? 'lag.admin.true' : 'lag.admin.false';
11
12
        return parent::render($text);
13
    }
14
15
    public function getType()
16
    {
17
        return 'boolean';
18
    }
19
}
20