Passed
Push — master ( c09e40...5f5d31 )
by Xu
08:45
created

UrlRule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
1
<?php
2
/**
3
 * @link http://www.tintsoft.com/
4
 * @copyright Copyright (c) 2012 TintSoft Technology Co. Ltd.
5
 * @license http://www.tintsoft.com/license/
6
 */
7
8
namespace yuncms\rest;
9
10
11
/**
12
 * Class UrlRule
13
 * @package yuncms\rest
14
 * @author Tongle Xu <[email protected]>
15
 */
16
class UrlRule extends \yii\rest\UrlRule
17
{
18
    /**
19
     * @var array tokens for supporting extra actions in addition to those listed in [[tokens]].
20
     * The keys are the tokens and the values are the corresponding action IDs.
21
     * These extra patterns will take precedence over [[tokens]].
22
     */
23
    public $extraTokens = [];
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function init()
29
    {
30
        parent::init();
31
        $this->tokens = $this->extraTokens + $this->tokens;
32
    }
33
}