SimpleCache   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getEncryptKey() 0 4 1
A setEncryptKey() 0 4 1
A encode() 0 4 1
A decode() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: jaredchu
5
 * Date: 09/08/2017
6
 * Time: 16:22
7
 */
8
9
namespace JC\Cache;
10
11
/**
12
 * Class EncryptCache
13
 * @package JC
14
 */
15
class SimpleCache extends BaseCache
16
{
17
    /**
18
     * @return string
19
     */
20
    public static function getEncryptKey()
21
    {
22
        return Manager::getEncryptKey();
23
    }
24
25
    /**
26
     * @param string $encryptKey
27
     */
28
    public static function setEncryptKey($encryptKey)
29
    {
30
        Manager::setEncryptKey($encryptKey);
31
    }
32
33
    /**
34
     * @param object $object
35
     * @return string
36
     */
37
    protected static function encode($object)
38
    {
39
        return Manager::encrypt(json_encode($object));
40
    }
41
42
    /**
43
     * @param string $string
44
     * @return object
45
     */
46
    protected static function decode($string)
47
    {
48
        return json_decode(Manager::decrypt($string));
49
    }
50
}