NodeToStringTransformer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 9 3
1
<?php
2
3
namespace TreeHouse\Feeder\Modifier\Data\Transformer;
4
5
class NodeToStringTransformer implements TransformerInterface
6
{
7
    /**
8
     * @inheritdoc
9
     */
10 6
    public function transform($value)
11
    {
12
        // if value is an array with a hash, that's a serialized node's text value
13 6
        if (is_array($value) && array_key_exists('#', $value)) {
14 2
            return $value['#'];
15
        }
16
17 4
        return $value;
18
    }
19
}
20