Completed
Push — master ( c26951...e01eb9 )
by Jared
02:09
created

SimpleCache::getEncryptKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: jaredchu
5
 * Date: 09/08/2017
6
 * Time: 16:22
7
 */
8
9
namespace JC;
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
}