Completed
Push — master ( 019e6d...d3d92b )
by Park Jong-Hun
03:25
created

Application::getUrl()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
3
namespace Core;
4
5
use JBZoo\Event\EventManager;
6
7
class Application
8
{
9
    private static $config = [];
10
11
    public static function setConfig(array $config)
12
    {
13
        self::$config = $config;
14
    }
15
16
    /**
17
     * Return url path with site url
18
     * @param  string $url sub url
19
     * @return string
20
     */
21
    public static function getUrl($url = '')
22
    {
23
        $url = $url === '/' ? '' : $url;
24
        return self::$config['url'] . $url;
25
    }
26
27
    public static function getPublicUrl($url = '')
28
    {
29
        $url = $url === '/' ? '' : $url;
30
        return self::$config['publicPath'] . $url;
31
    }
32
}
33