Completed
Pull Request — master (#34)
by
unknown
01:15
created

Module   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigUrl() 0 6 1
A getServerUrl() 0 8 2
1
<?php
2
3
namespace humhub\modules\discordapp;
4
5
use Yii;
6
use yii\helpers\Url;
7
8
class Module extends \humhub\components\Module
9
{
10
11
    public $resourcesPath = 'resources';
12
13
    /**
14
     * @inheritdoc
15
     */
16
    public function getConfigUrl()
17
    {
18
        return Url::to([
19
                    '/discordapp/admin'
20
        ]);
21
    }
22
23
    public function getServerUrl()
24
    {
25
        $url = $this->settings->get('serverUrl');
26
        if (empty($url)) {
27
            return 'https://discordapp.com';
28
        }
29
        return $url;
30
    }
31
32
}
33