Completed
Push — master ( e466ef...7ee5e1 )
by Vladimir
03:18
created

Service   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 2
cbo 0
dl 0
loc 28
ccs 11
cts 11
cp 1
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getParameter() 0 4 1
A setParameter() 0 4 1
A getWorkingDirectory() 0 7 2
A setWorkingDirectory() 0 4 1
1
<?php
2
3
/**
4
 * @copyright 2017 Vladimir Jimenez
5
 * @license   https://github.com/allejo/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx;
9
10
abstract class Service
11
{
12
    protected static $workingDirectory;
13
    protected static $parameters;
14
15 48
    public static function getParameter($key)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
16
    {
17 48
        return self::$parameters[$key];
18
    }
19
20 309
    public static function setParameter($key, $value)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
21
    {
22 309
        return (self::$parameters[$key] = $value);
23
    }
24
25 157
    public static function getWorkingDirectory()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
26
    {
27 157
        if (!self::$workingDirectory)
28 125
            return getcwd();
29
30 32
        return self::$workingDirectory;
31
    }
32
33 309
    public static function setWorkingDirectory($directory)
34
    {
35 309
        self::$workingDirectory = $directory;
36 309
    }
37
}
38