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::parseRequest()   B

Complexity

Conditions 5
Paths 5

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 5

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 8.8571
c 0
b 0
f 0
ccs 14
cts 14
cp 1
cc 5
eloc 12
nc 5
nop 2
crap 5
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