getHelper('hook_info'); $hook_templates = $hook_info->getHookTemplates(); $available_hooks = \array_keys($hook_templates); $ir = $this->createInterviewer($vars); $vars['machine_name'] = $ir->askMachineName(); $vars['name'] = $ir->askName(); $hook_question = new Question('Hook name'); $validator = new Chained( new Required(), new Choice($available_hooks, 'The value is not correct hook name.'), ); $hook_question->setValidator($validator); $hook_question->setAutocompleterValues($available_hooks); $vars['hook_name'] = $this->io()->askQuestion($hook_question); $vars['file_type'] = $hook_info::getFileType($vars['hook_name']); $assets->addFile('{machine_name}.{file_type}') ->inlineTemplate($hook_templates[$vars['hook_name']]) ->appendIfExists(9); } }