addOption('auto-fix', null, InputOption::VALUE_OPTIONAL, 'Automatically fix failed items (if possible)', false); } public function handle(): int { f_putenv('SPC_SKIP_TOOLCHAIN_CHECK=yes'); $fix_policy = match ($this->input->getOption('auto-fix')) { 'never' => FIX_POLICY_DIE, true, null => FIX_POLICY_AUTOFIX, default => FIX_POLICY_PROMPT, }; $doctor = new Doctor($this->output, $fix_policy); if ($doctor->checkAll()) { $this->output->writeln('Doctor check complete !'); return static::SUCCESS; } return static::FAILURE; } }