Skip to content

Commit

Permalink
Use Illuminate\Support\php_binary()
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Oct 22, 2024
1 parent d33d7b8 commit e15abfe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Foundation/Console/TestFallbackCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
namespace Orchestra\Testbench\Foundation\Console;

use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use Illuminate\Support\ProcessUtils;
use RuntimeException;
use Symfony\Component\Process\Exception\ProcessSignaledException;
use Symfony\Component\Process\Process;

use function Illuminate\Support\php_binary;
use function Laravel\Prompts\confirm;
use function Orchestra\Testbench\package_path;

Expand Down Expand Up @@ -110,7 +113,9 @@ protected function findComposer(): string
$composerPath = package_path('composer.phar');

if (file_exists($composerPath)) {
return '"'.PHP_BINARY.'" '.$composerPath;
return Collection::make([php_binary(), $composerPath])
->transform(fn ($path) => ProcessUtils::escapeArgument($path))
->join(' ');
}

return 'composer';
Expand Down

0 comments on commit e15abfe

Please sign in to comment.