Skip to content

Commit

Permalink
Static code tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc45 committed Mar 5, 2024
1 parent 8e19f26 commit 4966430
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/src/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -294,7 +296,7 @@ public function request(): string {
}

/**
* @param array $curl_parameters
* @param array<int,scalar> $curl_parameters
*
* @return void
*/
Expand All @@ -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;
}

Expand Down

0 comments on commit 4966430

Please sign in to comment.