Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo #782

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Commands/Concerns/InstallsFrankenPhpDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function ensureFrankenPhpBinaryIsInstalled()
/**
* Download the latest version of the FrankenPHP binary.
*
* @return bool
* @return string|false
*/
protected function downloadFrankenPhpBinary()
{
Expand Down Expand Up @@ -116,18 +116,18 @@ protected function downloadFrankenPhpBinary()

$this->error('FrankenPHP asset not found.');

return $path;
return false;
}

/**
* Ensure the installed FrankenPHP binary meets Octane's requirements.
*
* @param string $frakenPhpBinary
* @param string $frankenPhpBinary
* @return void
*/
protected function ensureFrankenPhpBinaryMeetsRequirements($frakenPhpBinary)
protected function ensureFrankenPhpBinaryMeetsRequirements($frankenPhpBinary)
{
$buildInfo = tap(new Process([$frakenPhpBinary, 'build-info'], base_path()))
$buildInfo = tap(new Process([$frankenPhpBinary, 'build-info'], base_path()))
->run()
->getOutput();

Expand Down Expand Up @@ -157,19 +157,19 @@ protected function ensureFrankenPhpBinaryMeetsRequirements($frakenPhpBinary)
$this->warn("Your FrankenPHP binary version (<fg=red>$version</>) may be incompatible with Octane.");

if ($this->confirm('Should Octane download the latest FrankenPHP binary version for your operating system?', true)) {
rename($frakenPhpBinary, "$frakenPhpBinary.backup");
rename($frankenPhpBinary, "$frankenPhpBinary.backup");

try {
$this->downloadFrankenPhpBinary();
} catch (Throwable $e) {
report($e);

rename("$frakenPhpBinary.backup", $frakenPhpBinary);
rename("$frankenPhpBinary.backup", $frankenPhpBinary);

return $this->warn('Unable to download FrankenPHP binary. The HTTP request exception has been logged.');
}

unlink("$frakenPhpBinary.backup");
unlink("$frankenPhpBinary.backup");
}
}
}