Bind   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A lumper() 0 8 2
A once() 0 3 1
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