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

Application   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setConfig() 0 4 1
A getUrl() 0 5 2
A getPublicUrl() 0 5 2
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