From de40007665ec12add527299ec41d72be38a1f94d Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Mon, 23 May 2022 22:07:29 +0100 Subject: [PATCH] Remove the use of deprecated composer option --no-suggest --- src/Tool/Command/BoxBuildCommand.php | 2 +- src/Tool/Command/ComposerBinPluginCommand.php | 2 +- src/Tool/Command/ComposerGlobalInstallCommand.php | 2 +- src/Tool/Command/ComposerGlobalMultiInstallCommand.php | 2 +- src/Tool/Command/ComposerInstallCommand.php | 2 +- src/Tool/Command/OptimisedComposerBinPluginCommand.php | 2 +- tests/Tool/Command/BoxBuildCommandTest.php | 2 +- tests/Tool/Command/ComposerInstallCommandTest.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Tool/Command/BoxBuildCommand.php b/src/Tool/Command/BoxBuildCommand.php index c6c43e2e..d2e0e8ce 100644 --- a/src/Tool/Command/BoxBuildCommand.php +++ b/src/Tool/Command/BoxBuildCommand.php @@ -24,7 +24,7 @@ public function __construct(string $repository, string $phar, string $bin, strin public function __toString(): string { return \sprintf( - 'git clone %s %s&& cd %s && git checkout %s && composer install --no-dev --no-suggest --prefer-dist -n && box compile && mv %s %s && chmod +x %s && cd && rm -rf %s', + 'git clone %s %s&& cd %s && git checkout %s && composer install --no-dev --prefer-dist -n && box compile && mv %s %s && chmod +x %s && cd && rm -rf %s', $this->repository, $this->targetDir(), $this->targetDir(), diff --git a/src/Tool/Command/ComposerBinPluginCommand.php b/src/Tool/Command/ComposerBinPluginCommand.php index 01145199..de66ceaa 100644 --- a/src/Tool/Command/ComposerBinPluginCommand.php +++ b/src/Tool/Command/ComposerBinPluginCommand.php @@ -22,7 +22,7 @@ public function __construct(string $package, string $namespace, Collection $link public function __toString(): string { - return \sprintf('composer global bin %s require --no-suggest --prefer-dist --update-no-dev -n %s%s', $this->namespace, $this->package, $this->linkCommand()); + return \sprintf('composer global bin %s require --prefer-dist --update-no-dev -n %s%s', $this->namespace, $this->package, $this->linkCommand()); } public function package(): string diff --git a/src/Tool/Command/ComposerGlobalInstallCommand.php b/src/Tool/Command/ComposerGlobalInstallCommand.php index b34aa836..1fef35c4 100644 --- a/src/Tool/Command/ComposerGlobalInstallCommand.php +++ b/src/Tool/Command/ComposerGlobalInstallCommand.php @@ -15,7 +15,7 @@ public function __construct(string $package) public function __toString(): string { - return \sprintf('composer global require --no-suggest --prefer-dist --update-no-dev -n %s', $this->package); + return \sprintf('composer global require --prefer-dist --update-no-dev -n %s', $this->package); } public function package(): string diff --git a/src/Tool/Command/ComposerGlobalMultiInstallCommand.php b/src/Tool/Command/ComposerGlobalMultiInstallCommand.php index 6b8c392b..1a2b1e70 100644 --- a/src/Tool/Command/ComposerGlobalMultiInstallCommand.php +++ b/src/Tool/Command/ComposerGlobalMultiInstallCommand.php @@ -27,6 +27,6 @@ public function __toString(): string return $command->package(); }, $this->commands->toArray())); - return \sprintf('composer global require --no-suggest --prefer-dist --update-no-dev -n %s', $packages); + return \sprintf('composer global require --prefer-dist --update-no-dev -n %s', $packages); } } diff --git a/src/Tool/Command/ComposerInstallCommand.php b/src/Tool/Command/ComposerInstallCommand.php index 9a8e646f..519c04c7 100644 --- a/src/Tool/Command/ComposerInstallCommand.php +++ b/src/Tool/Command/ComposerInstallCommand.php @@ -20,7 +20,7 @@ public function __construct(string $repository, string $targetDir, ?string $vers public function __toString(): string { return \sprintf( - 'git clone %s %s && cd %s && git checkout %s && composer install --no-dev --no-suggest --prefer-dist -n', + 'git clone %s %s && cd %s && git checkout %s && composer install --no-dev --prefer-dist -n', $this->repository, $this->targetDir, $this->targetDir, diff --git a/src/Tool/Command/OptimisedComposerBinPluginCommand.php b/src/Tool/Command/OptimisedComposerBinPluginCommand.php index 29ca3011..e7d0c62a 100644 --- a/src/Tool/Command/OptimisedComposerBinPluginCommand.php +++ b/src/Tool/Command/OptimisedComposerBinPluginCommand.php @@ -37,7 +37,7 @@ private function packagesGroupedByNamespace(): array private function commandToRun(string $namespace, array $packages): string { - return \sprintf('composer global bin %s require --no-suggest --prefer-dist --update-no-dev -n %s', $namespace, \implode(' ', $packages)); + return \sprintf('composer global bin %s require --prefer-dist --update-no-dev -n %s', $namespace, \implode(' ', $packages)); } private function commandsToRun(array $packagesGrouped): array diff --git a/tests/Tool/Command/BoxBuildCommandTest.php b/tests/Tool/Command/BoxBuildCommandTest.php index 8461e452..d095c848 100644 --- a/tests/Tool/Command/BoxBuildCommandTest.php +++ b/tests/Tool/Command/BoxBuildCommandTest.php @@ -44,7 +44,7 @@ public function test_it_generates_the_installation_command() $this->assertMatchesRegularExpression('#git clone '.self::REPOSITORY.'#', (string) $command); $this->assertMatchesRegularExpression('#cd /tools/behat#', (string) $command); $this->assertMatchesRegularExpression('#git checkout '.self::VERSION.'#', (string) $command); - $this->assertMatchesRegularExpression('#composer install --no-dev --no-suggest --prefer-dist -n#', (string) $command); + $this->assertMatchesRegularExpression('#composer install --no-dev --prefer-dist -n#', (string) $command); $this->assertMatchesRegularExpression('#box compile#', (string) $command); } diff --git a/tests/Tool/Command/ComposerInstallCommandTest.php b/tests/Tool/Command/ComposerInstallCommandTest.php index 0b860679..e9089fb4 100644 --- a/tests/Tool/Command/ComposerInstallCommandTest.php +++ b/tests/Tool/Command/ComposerInstallCommandTest.php @@ -25,7 +25,7 @@ public function test_it_generates_the_installation_command() $this->assertMatchesRegularExpression('#git clone '.self::REPOSITORY.'#', (string) $command); $this->assertMatchesRegularExpression('#git checkout '.self::VERSION.'#', (string) $command); - $this->assertMatchesRegularExpression('#composer install --no-dev --no-suggest --prefer-dist -n#', (string) $command); + $this->assertMatchesRegularExpression('#composer install --no-dev --prefer-dist -n#', (string) $command); } public function test_it_tries_to_guess_version_number_if_not_given_one()