Passed
Pull Request — master (#132)
by
unknown
02:36
created

PhpSerializer::unserialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Cache\Serializer;
6
7
use function serialize;
8
use function unserialize;
9
10
final class PhpSerializer implements SerializerInterface
11
{
12
    public function serialize(mixed $value): string
13
    {
14
        return serialize($value);
15
    }
16
17
    /**
18
     * @param string $data
19
     * @return mixed
20
     *
21
     * @psalm-suppress MixedArgumentTypeCoercion
22
     */
23
    public function unserialize(string $data): mixed
24
    {
25
        return unserialize($data);
26
    }
27
}
28