From b44c713acfd3f96053dfeba3a687c06906865ed2 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 26 Feb 2024 21:16:02 +0000 Subject: [PATCH] Fix PHP install command --- src/Console/Command/InstallCommand.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Console/Command/InstallCommand.php b/src/Console/Command/InstallCommand.php index f1878c1..eddd2a3 100644 --- a/src/Console/Command/InstallCommand.php +++ b/src/Console/Command/InstallCommand.php @@ -22,12 +22,15 @@ final class InstallCommand extends AbstractCommand public function execute(InputInterface $input, OutputInterface $output): int { $args = $input->getOption('args'); + $language = $input->getOption('language'); $workingDir = $input->getOption('working-dir'); - $language = $input->getOption('language') ?? (new DetermineProjectLanguage( - filesystem: $this->filesystem, - workingDir: $workingDir, - ))->getLanguage(); + if ($language === null) { + $language = (new DetermineProjectLanguage( + filesystem: $this->filesystem, + workingDir: $workingDir, + ))->getLanguage(); + } // TODO: Composer in Docker Compose? $process = Process::create( @@ -50,7 +53,7 @@ final class InstallCommand extends AbstractCommand */ private function getCommand(string $language, string $workingDir): array { - if ($language === ProjectLanguage::JavaScript->value) { + if ($language === ProjectLanguage::PHP->value) { return ['composer', 'install']; } elseif ($language === ProjectLanguage::JavaScript->value) { $packageManager = new DeterminePackageManager(