NullSerializer::getSerializedContentType()   A
last analyzed

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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Retrinko\Serializer\Serializers;
4
5
/**
6
 * Class NullSerializer
7
 * NOTICE! This class does not perform any serialization/unserialization.
8
 *
9
 * @package Retrinko\Serializer\Serializers
10
 */
11
class NullSerializer extends AbstractSerializer
12
{
13
    /**
14
     * Serialized content type.
15
     * type/lang[/serizalizationFunctions]
16
     */
17
    const SERIALIZED_CONTENT_TYPE = 'text/plain';
18
19
    /**
20
     * @param string $input
21
     * @return string
22
     */
23 1
    public function serialize($input)
24
    {
25 1
        return $input;
26
    }
27
28
    /**
29
     * @param string $input
30
     * @return string
31
     */
32 1
    public function unserialize($input)
33
    {
34 1
        return $input;
35
    }
36
37
    /**
38
     * @return string
39
     */
40 1
    public function getSerializedContentType()
41
    {
42 1
        return self::SERIALIZED_CONTENT_TYPE;
43
    }
44
}