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 ( 940f7c...e69234 )
by Robert
09:36
created

ChainedDependency   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 1
dl 0
loc 53
ccs 0
cts 21
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A evaluateDependency() 0 6 2
A generateDependencyData() 0 4 1
B isChanged() 0 11 6
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
 * ChainedDependency represents a dependency which is composed of a list of other dependencies.
12
 *
13
 * When [[dependOnAll]] is true, if any of the dependencies has changed, this dependency is
14
 * considered changed; When [[dependOnAll]] is false, if one of the dependencies has NOT changed,
15
 * this dependency is considered NOT changed.
16
 *
17
 * For more details and usage information on Cache, see the [guide article on caching](guide:caching-overview).
18
 *
19
 * @author Qiang Xue <[email protected]>
20
 * @since 2.0
21
 */
22
class ChainedDependency extends Dependency
23
{
24
    /**
25
     * @var Dependency[] list of dependencies that this dependency is composed of.
26
     * Each array element must be a dependency object.
27
     */
28
    public $dependencies = [];
29
    /**
30
     * @var bool whether this dependency is depending on every dependency in [[dependencies]].
31
     * Defaults to true, meaning if any of the dependencies has changed, this dependency is considered changed.
32
     * When it is set false, it means if one of the dependencies has NOT changed, this dependency
33
     * is considered NOT changed.
34
     */
35
    public $dependOnAll = true;
36
37
38
    /**
39
     * Evaluates the dependency by generating and saving the data related with dependency.
40
     * @param Cache $cache the cache component that is currently evaluating this dependency
41
     */
42
    public function evaluateDependency($cache)
43
    {
44
        foreach ($this->dependencies as $dependency) {
45
            $dependency->evaluateDependency($cache);
46
        }
47
    }
48
49
    /**
50
     * Generates the data needed to determine if dependency has been changed.
51
     * This method does nothing in this class.
52
     * @param Cache $cache the cache component that is currently evaluating this dependency
53
     * @return mixed the data needed to determine if dependency has been changed.
54
     */
55
    protected function generateDependencyData($cache)
56
    {
57
        return null;
58
    }
59
60
    /**
61
     * @inheritdoc
62
     */
63
    public function isChanged($cache)
64
    {
65
        foreach ($this->dependencies as $dependency) {
66
            if ($this->dependOnAll && $dependency->isChanged($cache)) {
67
                return true;
68
            } elseif (!$this->dependOnAll && !$dependency->isChanged($cache)) {
69
                return false;
70
            }
71
        }
72
        return !$this->dependOnAll;
73
    }
74
}
75