Completed
Push — master ( 58d973...681a3d )
by
unknown
05:43
created

MsgpackSerializer::getSupportedFormats()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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