Capsule::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PhpDbaCache;
4
5
/**
6
 * Cache Capsule Container
7
 *
8
 * @category PhpDbaCache
9
 */
10
class Capsule
11
{
12
    /**
13
     * Class name of the object
14
     * @var string
15
     */
16
    public $type;
17
18
    /**
19
     * The object that should be cached
20
     *
21
     * @var object
22
     */
23
    public $object;
24
25
    /**
26
     * If object or array should be vacuumed
27
     *
28
     * @var bool
29
     */
30
    public $fake;
31
32
    /**
33
     * Make-time as current unix timestamp in microseconds
34
     *
35
     * @var mixed
36
     */
37
    public $mtime;
38
39
    /**
40
     * Life-time as current unix timestamp in microseconds
41
     *
42
     * @var bool|int
43
     */
44
    public $ltime;
45
46
    /**
47
     * @param bool     $fake
48
     * @param int|bool $ltime
49
     * @param object   $object
50
     */
51
    public function __construct($fake, $ltime, $object)
52
    {
53
        $this->fake = $fake;
54
        $this->ltime = $ltime;
55
        $this->mtime = microtime(true);
56
        $this->object = $object;
57
        $this->type = get_class($object);
58
    }
59
}
60