ResponseSerializer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A serializeResponse() 0 4 1
1
<?php
2
3
namespace Tonic\Component\ApiLayer\JsonRpc\Response;
4
5
/**
6
 * Responds for response serialization to JSON.
7
 */
8
class ResponseSerializer implements ResponseSerializerInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function serializeResponse($version, AbstractResponse $response)
14
    {
15
        return json_encode(array_merge(['jsonrpc' => $version], $response->toArray()));
16
    }
17
}
18