addArgument('name', InputArgument::REQUIRED, 'Plugin name, for example foo/my-admin'); } /** * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { $name = $input->getArgument('name'); $output->writeln("Execute uninstall for plugin $name"); if (!strpos($name, '/')) { $output->writeln('Bad name, name must contain character \'/\' , for example foo/MyAdmin'); return self::FAILURE; } $namespace = Util::nameToNamespace($name); $uninstall_function = "\\{$namespace}\\Install::uninstall"; $plugin_const = "\\{$namespace}\\Install::WEBMAN_PLUGIN"; if (defined($plugin_const) && is_callable($uninstall_function)) { $uninstall_function(); } return self::SUCCESS; } }