From 064a1f05aec7c580c61b5708440074bfaa6e4561 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Tue, 16 Jun 2026 15:17:51 +0800 Subject: [PATCH] Fix phpstan --- src/StaticPHP/Command/ResetCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/StaticPHP/Command/ResetCommand.php b/src/StaticPHP/Command/ResetCommand.php index ee81c82a..ce22e7a9 100644 --- a/src/StaticPHP/Command/ResetCommand.php +++ b/src/StaticPHP/Command/ResetCommand.php @@ -4,10 +4,12 @@ declare(strict_types=1); namespace StaticPHP\Command; +use StaticPHP\Exception\SPCInternalException; use StaticPHP\Runtime\Shell\Shell; use StaticPHP\Util\FileSystem; use StaticPHP\Util\InteractiveTerm; use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Question\ConfirmationQuestion; @@ -46,6 +48,9 @@ class ResetCommand extends BaseCommand // Confirm with user unless --yes is specified if (!$this->input->getOption('yes')) { $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))) { InteractiveTerm::error(message: 'Reset operation cancelled.'); return static::SUCCESS;