From 3826e51caa99662dd67fd566188a0a8abe16b3e1 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 11 Sep 2017 12:38:54 -0400 Subject: [PATCH] Renaming some methods and props. --- src/Composer/Command/RemoveCommand.php | 2 +- src/Composer/Command/RequireCommand.php | 2 +- src/Composer/Command/UpdateCommand.php | 6 +++--- src/Composer/Installer.php | 11 ++++++----- tests/Composer/Test/InstallerTest.php | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Composer/Command/RemoveCommand.php b/src/Composer/Command/RemoveCommand.php index ec6f64308..493c6481f 100644 --- a/src/Composer/Command/RemoveCommand.php +++ b/src/Composer/Command/RemoveCommand.php @@ -131,7 +131,7 @@ EOT ->setApcuAutoloader($apcu) ->setUpdate(true) ->setUpdateWhitelist($packages) - ->setIndirectWhitelistDependencies(!$input->getOption('no-update-with-dependencies')) + ->setWhitelistNonRootDependencies(!$input->getOption('no-update-with-dependencies')) ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs')) ->setRunScripts(!$input->getOption('no-scripts')) ; diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 295701c8f..ccb65fb53 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -170,7 +170,7 @@ EOT ->setApcuAutoloader($apcu) ->setUpdate(true) ->setUpdateWhitelist(array_keys($requirements)) - ->setIndirectWhitelistDependencies($input->getOption('update-with-dependencies')) + ->setWhitelistNonRootDependencies($input->getOption('update-with-dependencies')) ->setAllWhitelistDependencies($input->getOption('update-with-all-dependencies')) ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs')) ->setPreferStable($input->getOption('prefer-stable')) diff --git a/src/Composer/Command/UpdateCommand.php b/src/Composer/Command/UpdateCommand.php index ac047c41a..fb2e36834 100644 --- a/src/Composer/Command/UpdateCommand.php +++ b/src/Composer/Command/UpdateCommand.php @@ -48,8 +48,8 @@ class UpdateCommand extends BaseCommand new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-suggest', null, InputOption::VALUE_NONE, 'Do not show package suggestions.'), - new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also dependencies of whitelisted packages to the whitelist, if those dependencies are not defined in root package.'), - new InputOption('with-all-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist.'), + new InputOption('with-dependencies', null, InputOption::VALUE_NONE, 'Add also dependencies of whitelisted packages to the whitelist, except those defined in root package.'), + new InputOption('with-all-dependencies', null, InputOption::VALUE_NONE, 'Add also all dependencies of whitelisted packages to the whitelist, including those defined in root package.'), new InputOption('verbose', 'v|vv|vvv', InputOption::VALUE_NONE, 'Shows more details including new commits pulled in when updating packages.'), new InputOption('optimize-autoloader', 'o', InputOption::VALUE_NONE, 'Optimize autoloader during autoloader dump.'), new InputOption('classmap-authoritative', 'a', InputOption::VALUE_NONE, 'Autoload classes from the classmap only. Implicitly enables `--optimize-autoloader`.'), @@ -146,7 +146,7 @@ EOT ->setApcuAutoloader($apcu) ->setUpdate(true) ->setUpdateWhitelist($input->getOption('lock') ? array('lock') : $packages) - ->setIndirectWhitelistDependencies($input->getOption('with-dependencies')) + ->setWhitelistNonRootDependencies($input->getOption('with-dependencies')) ->setAllWhitelistDependencies($input->getOption('with-all-dependencies')) ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs')) ->setPreferStable($input->getOption('prefer-stable')) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 168429ade..bfaffefd0 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -125,7 +125,7 @@ class Installer * @var array|null */ protected $updateWhitelist = null; - protected $whitelistIndirectDependencies = false; + protected $whitelistNonRootDependencies = false; protected $whitelistAllDependencies = false; /** @@ -1354,7 +1354,7 @@ class Installer $seen[$package->getId()] = true; $this->updateWhitelist[$package->getName()] = true; - if (!$this->whitelistIndirectDependencies && !$this->whitelistAllDependencies) { + if (!$this->whitelistNonRootDependencies && !$this->whitelistAllDependencies) { continue; } @@ -1660,12 +1660,13 @@ class Installer * This will NOT whitelist any dependencies that are also directly defined * in the root package. * - * @param bool $updateDependencies + * @param bool $updateNonRootDependencies + * * @return Installer */ - public function setIndirectWhitelistDependencies($updateDependencies = true) + public function setWhitelistNonRootDependencies($updateNonRootDependencies = true) { - $this->whitelistIndirectDependencies = (bool) $updateDependencies; + $this->whitelistNonRootDependencies = (bool) $updateNonRootDependencies; return $this; } diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index d6c0734a5..57d666189 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -224,7 +224,7 @@ class InstallerTest extends TestCase ->setUpdate(true) ->setDryRun($input->getOption('dry-run')) ->setUpdateWhitelist($input->getArgument('packages')) - ->setIndirectWhitelistDependencies($input->getOption('with-dependencies')) + ->setWhitelistNonRootDependencies($input->getOption('with-dependencies')) ->setAllWhitelistDependencies($input->getOption('with-all-dependencies')) ->setPreferStable($input->getOption('prefer-stable')) ->setPreferLowest($input->getOption('prefer-lowest'))