Skip to content

Commit

Permalink
Fix undefined array key "assets"
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Mar 26, 2024
1 parent 14a0eca commit 534d482
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Commands/Concerns/InstallsFrankenPhpDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ protected function downloadFrankenPhpBinary()
throw new RuntimeException('FrankenPHP binaries are currently only available for Linux (x86_64, aarch64) and macOS. Other systems should use the Docker images or compile FrankenPHP manually.');
}

$assets = Http::accept('application/vnd.github+json')
$content = Http::accept('application/vnd.github+json')
->withHeaders(['X-GitHub-Api-Version' => '2022-11-28'])
->get('https://api.github.com/repos/dunglas/frankenphp/releases/latest')['assets'];
->get('https://api.github.com/repos/dunglas/frankenphp/releases/latest');

$assets = $content['assets'] ?? [];

foreach ($assets as $asset) {
if ($asset['name'] !== $assetName) {
Expand Down

0 comments on commit 534d482

Please sign in to comment.