Module::getServerUrl()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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