From 4966430505f2898ad96b2529e581e0275b02b5a8 Mon Sep 17 00:00:00 2001 From: Lucas Bustamante Date: Tue, 5 Mar 2024 15:47:10 -0300 Subject: [PATCH] Static code tests --- src/src/RequestBuilder.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/src/RequestBuilder.php b/src/src/RequestBuilder.php index 14d32ddd..ef8f8677 100644 --- a/src/src/RequestBuilder.php +++ b/src/src/RequestBuilder.php @@ -4,8 +4,10 @@ use QIT_CLI\Exceptions\DoingAutocompleteException; use QIT_CLI\Exceptions\NetworkErrorException; -use QIT_CLI\IO\Input; use QIT_CLI\IO\Output; +use Symfony\Component\Console\Helper\QuestionHelper; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; class RequestBuilder { @@ -294,7 +296,7 @@ public function request(): string { } /** - * @param array $curl_parameters + * @param array $curl_parameters * * @return void */ @@ -314,12 +316,13 @@ protected function maybe_set_certificate_authority_file( array &$curl_parameters } // Ask the user if he wants us to solve it for them. - $output = App::make( Output::class ); - $input = App::make( Input::class ); + $output = App::make( OutputInterface::class ); + $input = App::make( InputInterface::class ); + $helper = App::make( QuestionHelper::class ); $question = new ConfirmationQuestion( '', false ); - if ( getenv( 'QIT_WINDOWS_DOWNLOAD_CA' ) != 'yes' && ! $input->isInteractive() || ! $output->askQuestion( $question ) ) { + if ( getenv( 'QIT_WINDOWS_DOWNLOAD_CA' ) !== 'yes' && ! $input->isInteractive() || ! $helper->ask( $input, $output, $question ) ) { return; }