Bind::lumper()   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 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Bavix\Lumper;
4
5
abstract class Bind
6
{
7
8
    /**
9
     * @var Lumper
10
     */
11
    protected static $lump;
12
13
    /**
14
     * @return Lumper
15
     */
16 1
    protected static function lumper()
17
    {
18 1
        if (!static::$lump)
19
        {
20 1
            static::$lump = new Lumper();
21
        }
22
23 1
        return static::$lump;
24
    }
25
26
    /**
27
     * @param string   $name
28
     * @param callable $callback
29
     *
30
     * @return mixed
31
     */
32 1
    public static function once($name, callable $callback)
33
    {
34 1
        return static::lumper()->once($callback, $name);
35
    }
36
37
}
38