Skip to content

Commit

Permalink
PHPStan Pro API - pass current PHP version
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 20, 2022
1 parent f091c56 commit 9044bfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Command/FixerApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
use function fopen;
use function fwrite;
use function getenv;
use function http_build_query;
use function ini_get;
use function is_dir;
use function is_file;
Expand All @@ -70,6 +71,7 @@
use function unlink;
use const PHP_BINARY;
use const PHP_URL_PORT;
use const PHP_VERSION_ID;

class FixerApplication
{
Expand Down Expand Up @@ -380,7 +382,7 @@ private function downloadPhar(
* @var array{url: string, version: string} $latestInfo
* @phpstan-ignore-next-line
*/
$latestInfo = Json::decode((string) await($client->get('https://fixer-download-api.phpstan.com/latest'), $loop, 5.0)->getBody(), Json::FORCE_ARRAY);
$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);
if ($currentVersion !== null && $latestInfo['version'] === $currentVersion) {
$this->writeInfoFile($infoPath, $latestInfo['version']);
$output->writeln('<fg=green>You\'re running the latest PHPStan Pro!</>');
Expand Down

0 comments on commit 9044bfc

Please sign in to comment.