Module::getServerUrl()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 3
nc 3
nop 0
1
<?php
2
3
namespace humhub\modules\discordapp;
4
5
use Yii;
6
use yii\helpers\Url;
7
use humhub\components\Module as BaseModule;
8
9
class Module extends BaseModule
10
{
11
12
    public $resourcesPath = 'resources';
13
14
    /**
15
     * @inheritdoc
16
     */
17
    public function getConfigUrl()
18
    {
19
        return Url::to(['/discordapp/admin']);
20
    }
21
22
    public function getServerUrl()
23
    {
24
        $url = $this->settings->get('serverUrl');
25
        if (empty($url)) {
26
            return 'https://discordapp.com' || 'https://discord.com';
27
        }
28
        return $url;
29
    }
30
31
    public function getOrder()
32
    {
33
        $sortOrder = $this->settings->get('sortOrder');
34
        if (empty($sortOrder)) {
35
            return '100';
36
        }
37
        return $sortOrder;
38
    }
39
}
40