Passed
Push — develop ( fc59e1...90305f )
by Jens
02:30
created

LinkService::getInstance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 9.4285
1
<?php
2
/**
3
 * Created by jensk on 12-10-2017.
4
 */
5
6
namespace CloudControl\Cms\services;
7
8
9
use CloudControl\Cms\cc\Request;
10
use CloudControl\Cms\components\LanguageComponent;
11
12
class LinkService
13
{
14
    private static $instance;
15
16
    /**
17
     * LinkService constructor.
18
     */
19
    protected function __construct()
20
    {}
21
22
    /**
23
     * @return LinkService
24
     */
25
    public static function getInstance()
26
    {
27
        if (!self::$instance instanceof LinkService) {
28
            self::$instance = new LinkService();
29
        }
30
        return self::$instance;
31
    }
32
33
    public static function get($relativePath)
34
    {
35
        if (isset($_SESSION[LanguageComponent::SESSION_PARAMETER_LANGUAGE_COMPONENT][LanguageComponent::SESSION_PARAMETER_LANGUAGE])) {
36
            dump('language logic');
37
        } else {
38
            return Request::$subfolders . $relativePath;
39
        }
40
    }
41
}