|
9 | 9 | use Override; |
10 | 10 | use PHPStan\Command\Bisect\BinarySearch; |
11 | 11 | use PHPStan\File\FileReader; |
| 12 | +use PHPStan\Internal\HttpClientFactory; |
12 | 13 | use Symfony\Component\Console\Command\Command; |
13 | 14 | use Symfony\Component\Console\Helper\ProgressBar; |
14 | 15 | use Symfony\Component\Console\Input\InputArgument; |
|
23 | 24 | use function chmod; |
24 | 25 | use function count; |
25 | 26 | use function escapeshellarg; |
26 | | -use function extension_loaded; |
27 | 27 | use function getenv; |
28 | 28 | use function implode; |
29 | 29 | use function is_array; |
@@ -107,24 +107,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int |
107 | 107 | return 1; |
108 | 108 | } |
109 | 109 |
|
110 | | - $headers = [ |
111 | | - 'Authorization' => 'token ' . $token, |
112 | | - 'Accept' => 'application/vnd.github.v3+json', |
113 | | - ]; |
114 | | - if (extension_loaded('zlib')) { |
115 | | - $headers['Accept-Encoding'] = 'gzip,deflate'; |
116 | | - } |
117 | | - |
118 | | - $client = new Client([ |
| 110 | + $client = HttpClientFactory::createClient([ |
119 | 111 | RequestOptions::TIMEOUT => 30, |
120 | 112 | RequestOptions::CONNECT_TIMEOUT => 10, |
121 | | - 'headers' => $headers, |
| 113 | + 'headers' => [ |
| 114 | + 'Authorization' => 'token ' . $token, |
| 115 | + 'Accept' => 'application/vnd.github.v3+json', |
| 116 | + ], |
122 | 117 | ]); |
123 | 118 |
|
124 | 119 | $io->section(sprintf('Fetching commits between %s and %s...', $good, $bad)); |
125 | 120 |
|
126 | 121 | try { |
127 | 122 | $commits = $this->getCommitsBetween($client, $good, $bad); |
| 123 | + exit; |
128 | 124 | } catch (GuzzleException $e) { |
129 | 125 | $io->error(sprintf('Failed to fetch commits from GitHub: %s', $e->getMessage())); |
130 | 126 | return 1; |
|
0 commit comments