src/Core/Application.php
public function registerHook(string $hook)
    {
        // Build a "Hookable" instance.
        // Hookable instances must extend the "Hookable" class.
        $instance = new $hook($this);
        $hooks = (array) $instance->hook;

        if (! method_exists($instance, 'register')) {
            return;
        }

        if (! empty($hooks)) {
            $this['action']->add($hooks, [$instance, 'register'], $instance->priority);
        } else {
            $instance->register();
        }
    }
public function registerHook(string $hook)
    {
        // Build a "Hookable" instance.
        // Hookable instances must extend the "Hookable" class.
        $instance = new $hook($this);
        $hooks = (array) $instance->hook;

        if (! method_exists($instance, 'register')) {
            return;
        }

        if (! empty($hooks)) {
            $this['action']->add($hooks, [$instance, 'register'], $instance->priority);
        } else {
            $instance->register();
        }
    }
public function registerHook ( string $ hook ) { // Build a "Hookable" instance. // Hookable instances must extend the "Hookable" class. $ instance = new $ hook ( $ this ) ; $ hooks = ( array ) $ instance -> hook ; if ( ! method_exists ( $ instance , 'register' ) ) { return ; } if ( ! empty ( $ hooks ) ) { $ this [ 'action' ] -> add ( $ hooks , [ $ instance , 'register' ] , $ instance -> priority ) ; } else { $ instance -> register ( ) ; } }
Create and register a hook instance.

@param string $hook
Create and register a hook instance .