Completed
Push — master ( 49e1a1...946836 )
by Chad
10s
created

NullSerializer::unserialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace SubjectivePHP\Psr\SimpleCache\Serializer;
4
5
use SubjectivePHP\Psr\SimpleCache\InvalidArgumentException;
6
7
/**
8
 * Serializer implementation that does nothing with the given data.
9
 */
10
final class NullSerializer implements SerializerInterface
11
{
12
    /**
13
     * Unserializes cached data into the original state.
14
     *
15
     * @param mixed $data The data to unserialize.
16
     *
17
     * @return mixed
18
     */
19
    public function unserialize($data)
20
    {
21
        return $data;
22
    }
23
24
    /**
25
     * Serializes the given data for storage in caching.
26
     *
27
     * @param mixed $value The data to serialize for caching.
28
     *
29
     * @return mixed The result of serializing the given $data.
30
     */
31
    public function serialize($value)
32
    {
33
        return $value;
34
    }
35
}
36