Property   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
c 1
b 0
f 0
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A path() 0 8 2
A get() 0 8 2
1
<?php
2
3
namespace Bavix\Flow;
4
5
class Property
6
{
7
8
    protected static $path;
9
    protected static $data = [];
10
11 2
    protected static function path(): string
12
    {
13 2
        if (!static::$path)
14
        {
15 1
            static::$path = \dirname(__DIR__, 2) . '/config/';
16
        }
17
18 2
        return static::$path;
19
    }
20
21 24
    public static function get($name)
22
    {
23 24
        if (empty(static::$data[$name]))
24
        {
25 2
            static::$data[$name] = require static::path() . $name . '.php';
26
        }
27
28 24
        return static::$data[$name];
29
    }
30
31
}
32