GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 560332...66e815 )
by Robert
11:59
created

ExpressionDependency   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
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 26
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateDependencyData() 0 4 1
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\caching;
9
10
/**
11
 * ExpressionDependency represents a dependency based on the result of a PHP expression.
12
 *
13
 * ExpressionDependency will use `eval()` to evaluate the PHP expression.
14
 * The dependency is reported as unchanged if and only if the result of the expression is
15
 * the same as the one evaluated when storing the data to cache.
16
 *
17
 * A PHP expression can be any PHP code that has a value. To learn more about what an expression is,
18
 * please refer to the [php manual](http://www.php.net/manual/en/language.expressions.php).
19
 *
20
 * For more details and usage information on Cache, see the [guide article on caching](guide:caching-overview).
21
 * 
22
 * @author Qiang Xue <[email protected]>
23
 * @since 2.0
24
 */
25
class ExpressionDependency extends Dependency
26
{
27
    /**
28
     * @var string the string representation of a PHP expression whose result is used to determine the dependency.
29
     * A PHP expression can be any PHP code that evaluates to a value. To learn more about what an expression is,
30
     * please refer to the [php manual](http://www.php.net/manual/en/language.expressions.php).
31
     */
32
    public $expression = 'true';
33
    /**
34
     * @var mixed custom parameters associated with this dependency. You may get the value
35
     * of this property in [[expression]] using `$this->params`.
36
     */
37
    public $params;
38
39
40
    /**
41
     * Generates the data needed to determine if dependency has been changed.
42
     * This method returns the result of the PHP expression.
43
     * @param Cache $cache the cache component that is currently evaluating this dependency
44
     * @return mixed the data needed to determine if dependency has been changed.
45
     */
46 1
    protected function generateDependencyData($cache)
47
    {
48 1
        return eval("return {$this->expression};");
49
    }
50
}
51