isShouldConfirm(); $shouldConfirm = value($callback); if ($shouldConfirm) { if ($this->input->getOption('force')) { return true; } $this->alert($warning); $confirmed = $this->confirm('Do you really wish to run this command?'); if (! $confirmed) { $this->comment('Command Cancelled!'); return false; } } return true; } protected function isShouldConfirm(): bool { return is_callable(['Composer\InstalledVersions', 'getRootPackage']) && (InstalledVersions::getRootPackage()['dev'] ?? false) === false; } }