Skip to content

Commit 9044bfc

Browse files
committed
PHPStan Pro API - pass current PHP version
1 parent f091c56 commit 9044bfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Command/FixerApplication.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
use function fopen;
5757
use function fwrite;
5858
use function getenv;
59+
use function http_build_query;
5960
use function ini_get;
6061
use function is_dir;
6162
use function is_file;
@@ -70,6 +71,7 @@
7071
use function unlink;
7172
use const PHP_BINARY;
7273
use const PHP_URL_PORT;
74+
use const PHP_VERSION_ID;
7375

7476
class FixerApplication
7577
{
@@ -380,7 +382,7 @@ private function downloadPhar(
380382
* @var array{url: string, version: string} $latestInfo
381383
* @phpstan-ignore-next-line
382384
*/
383-
$latestInfo = Json::decode((string) await($client->get('https://fixer-download-api.phpstan.com/latest'), $loop, 5.0)->getBody(), Json::FORCE_ARRAY);
385+
$latestInfo = Json::decode((string) await($client->get(sprintf('https://fixer-download-api.phpstan.com/latest?%s', http_build_query(['phpVersion' => PHP_VERSION_ID]))), $loop, 5.0)->getBody(), Json::FORCE_ARRAY);
384386
if ($currentVersion !== null && $latestInfo['version'] === $currentVersion) {
385387
$this->writeInfoFile($infoPath, $latestInfo['version']);
386388
$output->writeln('<fg=green>You\'re running the latest PHPStan Pro!</>');

0 commit comments

Comments
 (0)