IgbinarySerializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 3
eloc 4
c 2
b 0
f 2
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A unserialize() 0 3 1
A serialize() 0 3 1
A type() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Koded package.
5
 *
6
 * (c) Mihail Binev <[email protected]>
7
 *
8
 * Please view the LICENSE distributed with this source code
9
 * for the full copyright and license information.
10
 */
11
12
namespace Koded\Stdlib\Serializer;
13
14
use Koded\Stdlib\Serializer;
15
16
class IgbinarySerializer implements Serializer
17
{
18
    public function serialize(mixed $value): ?string
19
    {
20
        return \igbinary_serialize($value);
21
    }
22
23
    public function unserialize(string $value): mixed
24
    {
25
        return \igbinary_unserialize($value);
26
    }
27
28
    public function type(): string
29
    {
30
        return Serializer::IGBINARY;
31
    }
32
}
33