InverseBooleanTransformer::transform()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 4
nc 2
nop 1
crap 3
1
<?php
2
3
namespace TreeHouse\Feeder\Modifier\Data\Transformer;
4
5
class InverseBooleanTransformer implements TransformerInterface
6
{
7
    /**
8
     * @inheritdoc
9
     */
10 18
    public function transform($value)
11
    {
12 18
        if (is_null($value) || ($value === '')) {
13 4
            return;
14
        }
15
16 14
        return !(bool) $value;
17
    }
18
}
19