UrlRule   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 19
ccs 0
cts 6
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRule() 0 7 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipboxfactory/craft-rest/blob/master/LICENSE
6
 * @link       https://github.com/flipboxfactory/craft-rest
7
 */
8
9
namespace flipbox\craft\rest;
10
11
/**
12
 * @inheritdoc
13
 *
14
 * @author Flipbox Factory <[email protected]>
15
 * @since 1.0.0
16
 */
17
class UrlRule extends \yii\rest\UrlRule
18
{
19
    /**
20
     * The prefix to the action
21
     *
22
     * @var string
23
     */
24
    public $prepend;
25
26
    /**
27
     * @inheritdoc
28
     */
29
    protected function createRule($pattern, $prefix, $action)
30
    {
31
        if (!empty($this->prepend)) {
32
            $action = $this->prepend . '/' . $action;
33
        }
34
35
        return parent::createRule($pattern, $prefix, $action);
36
    }
37
}
38