Completed
Push — master ( 952fde...7bae76 )
by Vladimir
11s
created

Service   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 2
cbo 0
dl 0
loc 36
ccs 15
cts 15
cp 1
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A hasRunTimeFlag() 0 4 1
A setRuntimeFlag() 0 4 1
A resetRuntimeFlags() 0 4 1
A getWorkingDirectory() 0 9 2
A setWorkingDirectory() 0 4 1
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/stakx-io/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 $runTimeStatus;
14
    protected static $parameters;
15
16 93
    public static function hasRunTimeFlag($status)
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...
17
    {
18 93
        return self::$runTimeStatus & $status;
19
    }
20
21 311
    public static function setRuntimeFlag($status)
22
    {
23 311
        self::$runTimeStatus |= $status;
24 311
    }
25
26 311
    public static function resetRuntimeFlags()
27
    {
28 311
        self::$runTimeStatus = 0;
29 311
    }
30
31 167
    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...
32
    {
33 167
        if (!self::$workingDirectory)
34
        {
35 135
            return getcwd();
36
        }
37
38 32
        return self::$workingDirectory;
39
    }
40
41 311
    public static function setWorkingDirectory($directory)
42
    {
43 311
        self::$workingDirectory = $directory;
44 311
    }
45
}
46