Property::path()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 0
crap 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