Completed
Push — 0.3-dev ( 291149...449c2f )
by Arnaud
14:26
created

Boolean   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 0
cbo 1
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 7 2
A getType() 0 4 1
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