Completed
Push — master ( 3b577d...673a4c )
by Sergey
02:52
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 Sergey Makinen (https://makinen.ru)
7
 * @license   https://github.com/sergeymakinen/yii2-php-file-cache/blob/master/LICENSE The MIT License
8
 */
9
10
namespace sergeymakinen\caching;
11
12
use yii\base\Object;
13
14
/**
15
 * Allows caching a value along with a PHP code in [[PhpFileCache]].
16
 */
17
class ValueWithBootstrap extends Object
18
{
19
    /**
20
     * @var string the PHP code represented by this object.
21
     */
22
    public $bootstrap;
23
24
    /**
25
     * @var mixed the value represented by this object.
26
     */
27
    public $value;
28
29
    /**
30
     * Creates a new object.
31
     *
32
     * @param mixed $value the value represented by this object.
33
     * @param string $bootstrap the PHP code represented by this object.
34
     * @param array $config name-value pairs that will be used to initialize the object properties.
35
     */
36 5
    public function __construct($value, $bootstrap, $config = [])
37
    {
38 5
        $this->value = $value;
39 5
        $this->bootstrap = $bootstrap;
40 5
        parent::__construct($config);
41 5
    }
42
}
43