*/ protected $arguments = [ 'plugins' => 'One or more plugins as vendor/plugin', ]; /** * @param list $pluginKeys */ public function run(array $pluginKeys): int { $validation = service('validation'); /** @var list $errors */ $errors = []; foreach ($pluginKeys as $pluginKey) { // TODO: change validation of pluginKey if (! $validation->check($pluginKey, 'required')) { $errors = [...$errors, ...$validation->getErrors()]; continue; } if (! service('plugins')->uninstall($pluginKey)) { $errors[] = sprintf('Something happened when removing %s', $pluginKey); } } foreach ($errors as $error) { CLI::error($error . PHP_EOL); } return $errors === [] ? 0 : 1; } }