BooleanField::cast()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 6
rs 9.4286
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace Tacone\Bees\Field;
4
5
class BooleanField extends Field
6
{
7
    public function cast()
8
    {
9
        $value = $this->value();
10
        if ($value === "false") return false;
11
        return (boolean)$value;
12
    }
13
}
14