mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 15:25:36 +08:00
Fix phpstan
This commit is contained in:
@@ -4,10 +4,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace StaticPHP\Command;
|
namespace StaticPHP\Command;
|
||||||
|
|
||||||
|
use StaticPHP\Exception\SPCInternalException;
|
||||||
use StaticPHP\Runtime\Shell\Shell;
|
use StaticPHP\Runtime\Shell\Shell;
|
||||||
use StaticPHP\Util\FileSystem;
|
use StaticPHP\Util\FileSystem;
|
||||||
use StaticPHP\Util\InteractiveTerm;
|
use StaticPHP\Util\InteractiveTerm;
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
use Symfony\Component\Console\Attribute\AsCommand;
|
||||||
|
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
||||||
|
|
||||||
@@ -46,6 +48,9 @@ class ResetCommand extends BaseCommand
|
|||||||
// Confirm with user unless --yes is specified
|
// Confirm with user unless --yes is specified
|
||||||
if (!$this->input->getOption('yes')) {
|
if (!$this->input->getOption('yes')) {
|
||||||
$helper = $this->getHelper('question');
|
$helper = $this->getHelper('question');
|
||||||
|
if (!$helper instanceof QuestionHelper) {
|
||||||
|
throw new SPCInternalException('Question helper not provided');
|
||||||
|
}
|
||||||
if (!$helper->ask($this->input, $this->output, new ConfirmationQuestion('Are you sure you want to continue? [y/N] ', false))) {
|
if (!$helper->ask($this->input, $this->output, new ConfirmationQuestion('Are you sure you want to continue? [y/N] ', false))) {
|
||||||
InteractiveTerm::error(message: 'Reset operation cancelled.');
|
InteractiveTerm::error(message: 'Reset operation cancelled.');
|
||||||
return static::SUCCESS;
|
return static::SUCCESS;
|
||||||
|
|||||||
Reference in New Issue
Block a user