Passed
Branch master (6e4050)
by Scott
02:58
created

Autoload::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
namespace Desmond;
3
use Desmond\data_types\LambdaType;
4
use Desmond\data_types\SymbolType;
5
6
class Autoload
7
{
8
    private static $functions = [];
9
10 4
    public static function reset()
11
    {
12 4
        self::$functions = [];
13 4
    }
14
15 1
    public static function getLoadFunctions()
16
    {
17 1
        return self::$functions;
18
    }
19
20 3
    public static function register(LambdaType $lambda)
21
    {
22 3
        self::$functions[] = $lambda;
23 3
    }
24
25 11
    public static function run(SymbolType $symbol)
26
    {
27 11
        foreach (self::$functions as $function) {
28 2
            $function->run([$symbol]);
29
        }
30 11
    }
31
}
32