protected function onEvent($arg) { foreach ($this->onEvent ?: [] as $handler) { call_user_func($handler, $arg); } }