NopPacker   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A pack() 0 3 1
A unpack() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Cache package.
5
 *
6
 * Copyright (c) Daniel González
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @author Daniel González <[email protected]>
12
 * @author Arnold Daniels <[email protected]>
13
 */
14
15
declare(strict_types=1);
16
17
namespace Desarrolla2\Cache\Packer;
18
19
use Desarrolla2\Cache\Packer\PackerInterface;
20
21
/**
22
 * Don't pack, just straight passthrough
23
 */
24
class NopPacker implements PackerInterface
25
{
26
    /**
27
     * Get cache type (might be used as file extension)
28
     *
29
     * @return string
30
     */
31
    public function getType()
32
    {
33
        return 'data';
34
    }
35
36
    /**
37
     * Pack the value
38
     * 
39
     * @param mixed $value
40
     * @return mixed
41
     */
42 140
    public function pack($value)
43
    {
44 140
        return $value;
45
    }
46
    
47
    /**
48
     * Unpack the value
49
     * 
50
     * @param mixed $packed
51
     * @return mixed
52
     */
53 73
    public function unpack($packed)
54
    {
55 73
        return $packed;
56
    }
57
}
58