public function add_event_listener(string $event)
    {
        // Automatically instantiate this class
        if ( class_exists("\App\Boot") ) {
            // Excute a boot instance
            $boot = new \App\Boot();

            if ( method_exists($boot, $event) ) {
                call_user_func([$boot, $event], $this->server);
            }

            // Listen Background task listener
            if ($event == 'onBoot') {
                $this->server->on('task', [$boot, 'onTask']);
                $this->server->on('finish', [$boot, 'onFinish']);
            }
        }
    }
public function add_event_listener(string $event)
    {
        // Automatically instantiate this class
        if ( class_exists("\App\Boot") ) {
            // Excute a boot instance
            $boot = new \App\Boot();

            if ( method_exists($boot, $event) ) {
                call_user_func([$boot, $event], $this->server);
            }

            // Listen Background task listener
            if ($event == 'onBoot') {
                $this->server->on('task', [$boot, 'onTask']);
                $this->server->on('finish', [$boot, 'onFinish']);
            }
        }
    }
public function add_event_listener ( string $ event ) { // Automatically instantiate this class if ( class_exists ( "\App\Boot" ) ) { // Excute a boot instance $ boot = new \ App \ Boot ( ) ; if ( method_exists ( $ boot , $ event ) ) { call_user_func ( [ $ boot , $ event ] , $ this -> server ) ; } // Listen Background task listener if ( $ event == 'onBoot' ) { $ this -> server -> on ( 'task' , [ $ boot , 'onTask' ] ) ; $ this -> server -> on ( 'finish' , [ $ boot , 'onFinish' ] ) ; } } }
Add envent Listener

@param string $event
@return void
Add envent Listener