Igbinary   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 4 1
A unserialize() 0 4 1
1
<?php
2
/**
3
 * For the full copyright and license information, please view the LICENSE
4
 * file that was distributed with this source code.
5
 *
6
 * @author Nikita Vershinin <[email protected]>
7
 * @license MIT
8
 */
9
namespace Endeveit\Cache\Serializers;
10
11
use Endeveit\Cache\Interfaces\Serializer;
12
13
/**
14
 * Serializer that uses igbinary extension.
15
 * @link https://github.com/igbinary/igbinary
16
 */
17
class Igbinary implements Serializer
18
{
19
20
    /**
21
     * {@inheritdoc}
22
     *
23
     * @param  mixed  $value
24
     * @return string
25
     */
26
    public function serialize($value)
27
    {
28
        return igbinary_serialize($value);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     *
34
     * @param  string $str
35
     * @return mixed
36
     */
37
    public function unserialize($str)
38
    {
39
        return igbinary_unserialize($str);
40
    }
41
}
42