Completed
Push — master ( f13667...6d3ced )
by Sergey
04:50
created

ValueWithBootstrap::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * Yii 2 PHP file cache
4
 *
5
 * @see       https://github.com/sergeymakinen/yii2-php-file-cache
6
 * @copyright Copyright (c) 2016-2017 Sergey Makinen (https://makinen.ru)
7
 * @license   https://github.com/sergeymakinen/yii2-php-file-cache/blob/master/LICENSE MIT License
8
 */
9
10
namespace sergeymakinen\yii\phpfilecache;
11
12
use yii\base\Object;
13
14
/**
15
 * Allows caching a value along with a PHP code in [[Cache]].
16
 */
17
class ValueWithBootstrap extends Object
18
{
19
    /**
20
     * @var string|\Closure the PHP code represented by this object.
21
     * Since 1.1 it can also be a Closure serializable by VarDumper.
22
     */
23
    public $bootstrap;
24
25
    /**
26
     * @var mixed the value represented by this object.
27
     */
28
    public $value;
29
30
    /**
31
     * Creates a new object.
32
     * @param mixed $value the value represented by this object.
33
     * @param string|\Closure $bootstrap the PHP code represented by this object.
34
     * Since 1.1 it can also be a Closure serializable by VarDumper.
35
     * @param array $config name-value pairs that will be used to initialize the object properties.
36
     */
37 15
    public function __construct($value, $bootstrap, $config = [])
38
    {
39 15
        $this->value = $value;
40 15
        $this->bootstrap = $bootstrap;
41 15
        parent::__construct($config);
42 15
    }
43
}
44