core/Hook.php
public static function on($name, $value, $prepend = false)
    {
        $object = new HookEvent(['handler' => $value]);
        
        if ($prepend) {
            array_unshift(static::$_hooks[$name], $object);
        } else {
            static::$_hooks[$name][] = $object;
        }
    }
public static function on($name, $value, $prepend = false)
    {
        $object = new HookEvent(['handler' => $value]);
        
        if ($prepend) {
            array_unshift(static::$_hooks[$name], $object);
        } else {
            static::$_hooks[$name][] = $object;
        }
    }
public static function on ( $ name , $ value , $ prepend = false ) { $ object = new HookEvent ( [ 'handler' => $ value ] ) ; if ( $ prepend ) { array_unshift ( static :: $ _hooks [ $ name ] , $ object ) ; } else { static :: $ _hooks [ $ name ] [ ] = $ object ; } }
Register a hook listener.

Define the name of the type of listener.

@param string $name The name of the hook.
@param callable|array $value An array with `[$object, 'method']` or a callable function `function($hook) {}`.
@param boolean $prepend Whether to prepend the item to the start or as by default to the end of the stack.
Register a hook listener .