NullSerializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 34
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 4 1
A unserialize() 0 4 1
A getSerializedContentType() 0 4 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
}