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

LinkService   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getInstance() 0 7 2
A get() 0 8 2
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
}