JsonSerializer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 8 2
1
<?php
2
3
namespace TreeHouse\Queue\Message\Serializer;
4
5
class JsonSerializer implements SerializerInterface
6
{
7
    /**
8
     * @inheritdoc
9
     */
10 10
    public function serialize($value)
11
    {
12 10
        if (!is_string($value)) {
13 9
            $value = json_encode($value);
14
        }
15
16 10
        return $value;
17
    }
18
}
19