Module   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 2
dl 0
loc 23
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isPanel() 0 4 1
A redirectPanel() 0 11 1
1
<?php
2
/**
3
 * HiPanel core package
4
 *
5
 * @link      https://hipanel.com/
6
 * @package   hipanel-core
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2014-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel;
12
13
use Yii;
14
15
/**
16
 * HiPanel Core Module.
17
 */
18
class Module extends \hipanel\base\Module
19
{
20
    public $notPanel;
21
22
    public $panelUrl;
23
24
    public function isPanel()
25
    {
26
        return !$this->notPanel;
27
    }
28
29
    public function redirectPanel()
30
    {
31
        $request = Yii::$app->request;
32
        $path = $request->getPathInfo();
33
        $vars = $request->get();
34
35
        $url = $this->panelUrl . '/' . $path . '?' . http_build_query($vars);
36
37
        Yii::$app->response->redirect($url);
38
        Yii::$app->end();
39
    }
40
}
41