ValueWithBootstrap   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 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-2018 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\BaseObject;
13
14
/**
15
 * Allows caching a value along with a PHP code in [[Cache]].
16
 */
17
class ValueWithBootstrap extends BaseObject
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