Completed
Push — master ( a15a3c...decc90 )
by
unknown
04:44
created

JsonSerializer::getDefaultFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace MediaMonks\RestApiBundle\Serializer;
4
5
use MediaMonks\RestApiBundle\Request\Format;
6
7
class JsonSerializer extends AbstractSerializer implements SerializerInterface
8
{
9
    /**
10
     * @param $data
11
     * @param $format
12
     * @return mixed|string
13
     */
14 21
    public function serialize($data, $format)
15
    {
16 21
        return json_encode($data);
17
    }
18
19
    /**
20
     * @return array
21
     */
22 22
    public function getSupportedFormats()
23
    {
24 22
        return [Format::FORMAT_JSON];
25
    }
26
27
    /**
28
     * @return string
29
     */
30 1
    public function getDefaultFormat()
31
    {
32 1
        return Format::FORMAT_JSON;
33
    }
34
}
35