14
14
use Symfony \Component \Console \Input \InputInterface ;
15
15
use Symfony \Component \Console \Output \OutputInterface ;
16
16
use Symfony \Component \Finder \Finder ;
17
- use Symfony \Component \Process \PhpExecutableFinder ;
18
17
use Symfony \Component \Process \Process ;
19
18
19
+ use function Illuminate \Support \php_binary ;
20
20
use function Laravel \Prompts \confirm ;
21
21
use function Laravel \Prompts \multiselect ;
22
22
use function Laravel \Prompts \select ;
@@ -397,7 +397,7 @@ protected function installInertiaStack()
397
397
398
398
// Middleware...
399
399
(new Filesystem )->ensureDirectoryExists (app_path ('Http/Middleware ' ));
400
- (new Process ([$ this -> phpBinary (), 'artisan ' , 'inertia:middleware ' , 'HandleInertiaRequests ' , '--force ' ], base_path ()))
400
+ (new Process ([php_binary (), 'artisan ' , 'inertia:middleware ' , 'HandleInertiaRequests ' , '--force ' ], base_path ()))
401
401
->setTimeout (null )
402
402
->run (function ($ type , $ output ) {
403
403
$ this ->output ->write ($ output );
@@ -656,7 +656,7 @@ protected function requireComposerPackages($packages)
656
656
$ composer = $ this ->option ('composer ' );
657
657
658
658
if ($ composer !== 'global ' ) {
659
- $ command = [$ this -> phpBinary (), $ composer , 'require ' ];
659
+ $ command = [php_binary (), $ composer , 'require ' ];
660
660
}
661
661
662
662
$ command = array_merge (
@@ -682,7 +682,7 @@ protected function removeComposerDevPackages($packages)
682
682
$ composer = $ this ->option ('composer ' );
683
683
684
684
if ($ composer !== 'global ' ) {
685
- $ command = [$ this -> phpBinary (), $ composer , 'remove ' , '--dev ' ];
685
+ $ command = [php_binary (), $ composer , 'remove ' , '--dev ' ];
686
686
}
687
687
688
688
$ command = array_merge (
@@ -708,7 +708,7 @@ protected function requireComposerDevPackages($packages)
708
708
$ composer = $ this ->option ('composer ' );
709
709
710
710
if ($ composer !== 'global ' ) {
711
- $ command = [$ this -> phpBinary (), $ composer , 'require ' , '--dev ' ];
711
+ $ command = [php_binary (), $ composer , 'require ' , '--dev ' ];
712
712
}
713
713
714
714
$ command = array_merge (
@@ -761,7 +761,7 @@ protected static function updateNodePackages(callable $callback, $dev = true)
761
761
protected function runDatabaseMigrations ()
762
762
{
763
763
if (confirm ('New database migrations were added. Would you like to re-run your migrations? ' , true )) {
764
- (new Process ([$ this -> phpBinary (), 'artisan ' , 'migrate:fresh ' , '--force ' ], base_path ()))
764
+ (new Process ([php_binary (), 'artisan ' , 'migrate:fresh ' , '--force ' ], base_path ()))
765
765
->setTimeout (null )
766
766
->run (function ($ type , $ output ) {
767
767
$ this ->output ->write ($ output );
@@ -795,16 +795,6 @@ protected function removeDarkClasses(Finder $finder)
795
795
}
796
796
}
797
797
798
- /**
799
- * Get the path to the appropriate PHP binary.
800
- *
801
- * @return string
802
- */
803
- protected function phpBinary ()
804
- {
805
- return (new PhpExecutableFinder ())->find (false ) ?: 'php ' ;
806
- }
807
-
808
798
/**
809
799
* Run the given commands.
810
800
*
0 commit comments