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 ( c73de3...97c43c )
by Robert
13:22
created

CompositeUrlRule   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 3
dl 0
loc 62
rs 10
c 0
b 0
f 0
ccs 24
cts 24
cp 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
createRules() 0 1 ?
A init() 0 5 1
B parseRequest() 0 19 5
A createUrl() 0 11 3
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\web;
9
10
use Yii;
11
use yii\base\Object;
12
13
/**
14
 * CompositeUrlRule is the base class for URL rule classes that consist of multiple simpler rules.
15
 *
16
 * @author Qiang Xue <[email protected]>
17
 * @since 2.0
18
 */
19
abstract class CompositeUrlRule extends Object implements UrlRuleInterface
20
{
21
    /**
22
     * @var UrlRuleInterface[] the URL rules contained in this composite rule.
23
     * This property is set in [[init()]] by the return value of [[createRules()]].
24
     */
25
    protected $rules = [];
26
27
28
    /**
29
     * Creates the URL rules that should be contained within this composite rule.
30
     * @return UrlRuleInterface[] the URL rules
31
     */
32
    abstract protected function createRules();
33
34
    /**
35
     * @inheritdoc
36
     */
37 11
    public function init()
38
    {
39 11
        parent::init();
40 11
        $this->rules = $this->createRules();
41 11
    }
42
43
    /**
44
     * @inheritdoc
45
     */
46 1
    public function parseRequest($manager, $request)
47
    {
48 1
        foreach ($this->rules as $rule) {
49
            /* @var $rule \yii\web\UrlRule */
50 1
            $result = $rule->parseRequest($manager, $request);
51 1
            if (YII_DEBUG) {
52 1
                Yii::trace([
53 1
                    'rule' => method_exists($rule, '__toString') ? $rule->__toString() : get_class($rule),
54 1
                    'match' => $result !== false,
55 1
                    'parent' => self::className()
56 1
                ], __METHOD__);
57 1
            }
58 1
            if ($result !== false) {
59 1
                return $result;
60
            }
61 1
        }
62
63 1
        return false;
64
    }
65
66
    /**
67
     * @inheritdoc
68
     */
69 1
    public function createUrl($manager, $route, $params)
70
    {
71 1
        foreach ($this->rules as $rule) {
72
            /* @var $rule \yii\web\UrlRule */
73 1
            if (($url = $rule->createUrl($manager, $route, $params)) !== false) {
74 1
                return $url;
75
            }
76 1
        }
77
78 1
        return false;
79
    }
80
}
81