Passed
Push — master ( 75fde3...2885b2 )
by Бабичев
03:43
created

Bind::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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