Conditions | 5 |
Paths | 4 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public static function addHookAction(string $name, \Closure $callback, int $order = 10) |
||
12 | { |
||
13 | if (!isset(static::$hookActions[$name]) || !is_array(static::$hookActions[$name])) { |
||
14 | static::$hookActions[$name] = []; |
||
15 | } |
||
16 | if (!isset(static::$hookActions[$name][$order]) || !is_array(static::$hookActions[$name][$order])) { |
||
17 | static::$hookActions[$name][$order] = []; |
||
18 | } |
||
19 | static::$hookActions[$name][$order][] = $callback; |
||
20 | } |
||
50 |