Removed passing of parameters with default value
parent
cda6e8bea6
commit
002fd39bc6
|
@ -234,7 +234,7 @@ EOT
|
|||
->setApcuAutoloader($config->get('apcu-autoloader'));
|
||||
|
||||
if (!$composer->getLocker()->isLocked()) {
|
||||
$installer->setUpdate(true);
|
||||
$installer->setUpdate();
|
||||
}
|
||||
|
||||
if ($disablePlugins) {
|
||||
|
@ -254,7 +254,7 @@ EOT
|
|||
&& (
|
||||
$input->getOption('remove-vcs')
|
||||
|| !$io->isInteractive()
|
||||
|| $io->askConfirmation('<info>Do you want to remove the existing VCS (.git, .svn..) history?</info> [<comment>Y,n</comment>]? ', true)
|
||||
|| $io->askConfirmation('<info>Do you want to remove the existing VCS (.git, .svn..) history?</info> [<comment>Y,n</comment>]? ')
|
||||
)
|
||||
) {
|
||||
$finder = new Finder();
|
||||
|
@ -414,7 +414,7 @@ EOT
|
|||
$fs = new Filesystem();
|
||||
$fs->removeDirectory($realDir);
|
||||
exit(130);
|
||||
}, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,6 @@ EOT
|
|||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
return parent::doExecute($input, $output, false);
|
||||
return parent::doExecute($input, $output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ EOT
|
|||
|
||||
if ($input->isInteractive()) {
|
||||
$io->writeError(array('', $json, ''));
|
||||
if (!$io->askConfirmation('Do you confirm generation [<comment>yes</comment>]? ', true)) {
|
||||
if (!$io->askConfirmation('Do you confirm generation [<comment>yes</comment>]? ')) {
|
||||
$io->writeError('<error>Command aborted</error>');
|
||||
|
||||
return 1;
|
||||
|
@ -143,14 +143,14 @@ EOT
|
|||
if (!$this->hasVendorIgnore($ignoreFile)) {
|
||||
$question = 'Would you like the <info>vendor</info> directory added to your <info>.gitignore</info> [<comment>yes</comment>]? ';
|
||||
|
||||
if ($io->askConfirmation($question, true)) {
|
||||
if ($io->askConfirmation($question)) {
|
||||
$this->addVendorIgnore($ignoreFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$question = 'Would you like to install dependencies now [<comment>yes</comment>]? ';
|
||||
if ($input->isInteractive() && $this->hasDependencies($options) && $io->askConfirmation($question, true)) {
|
||||
if ($input->isInteractive() && $this->hasDependencies($options) && $io->askConfirmation($question)) {
|
||||
$this->installDependencies($output);
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ EOT
|
|||
$question = 'Would you like to define your dependencies (require) interactively [<comment>yes</comment>]? ';
|
||||
$require = $input->getOption('require');
|
||||
$requirements = array();
|
||||
if ($require || $io->askConfirmation($question, true)) {
|
||||
if ($require || $io->askConfirmation($question)) {
|
||||
$requirements = $this->determineRequirements($input, $output, $require, $platformRepo, $preferredStability);
|
||||
}
|
||||
$input->setOption('require', $requirements);
|
||||
|
@ -366,7 +366,7 @@ EOT
|
|||
$question = 'Would you like to define your dev dependencies (require-dev) interactively [<comment>yes</comment>]? ';
|
||||
$requireDev = $input->getOption('require-dev');
|
||||
$devRequirements = array();
|
||||
if ($requireDev || $io->askConfirmation($question, true)) {
|
||||
if ($requireDev || $io->askConfirmation($question)) {
|
||||
$devRequirements = $this->determineRequirements($input, $output, $requireDev, $platformRepo, $preferredStability);
|
||||
}
|
||||
$input->setOption('require-dev', $devRequirements);
|
||||
|
|
|
@ -158,7 +158,7 @@ EOT
|
|||
} elseif (isset($composer[$altType][$package])) {
|
||||
$io->writeError('<warning>' . $composer[$altType][$package] . ' could not be found in ' . $type . ' but it is present in ' . $altType . '</warning>');
|
||||
if ($io->isInteractive()) {
|
||||
if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [<comment>yes</comment>]? ', true)) {
|
||||
if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [<comment>yes</comment>]? ')) {
|
||||
if ($dryRun) {
|
||||
$toRemove[$altType][] = $composer[$altType][$package];
|
||||
} else {
|
||||
|
@ -178,7 +178,7 @@ EOT
|
|||
foreach ($matches as $matchedPackage) {
|
||||
$io->writeError('<warning>' . $matchedPackage . ' could not be found in ' . $type . ' but it is present in ' . $altType . '</warning>');
|
||||
if ($io->isInteractive()) {
|
||||
if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [<comment>yes</comment>]? ', true)) {
|
||||
if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [<comment>yes</comment>]? ')) {
|
||||
if ($dryRun) {
|
||||
$toRemove[$altType][] = $matchedPackage;
|
||||
} else {
|
||||
|
@ -249,7 +249,7 @@ EOT
|
|||
->setOptimizeAutoloader($optimize)
|
||||
->setClassMapAuthoritative($authoritative)
|
||||
->setApcuAutoloader($apcu)
|
||||
->setUpdate(true)
|
||||
->setUpdate()
|
||||
->setInstall(!$input->getOption('no-install'))
|
||||
->setUpdateAllowList($packages)
|
||||
->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies)
|
||||
|
|
|
@ -302,7 +302,7 @@ EOT
|
|||
->setOptimizeAutoloader($optimize)
|
||||
->setClassMapAuthoritative($authoritative)
|
||||
->setApcuAutoloader($apcu)
|
||||
->setUpdate(true)
|
||||
->setUpdate()
|
||||
->setInstall(!$input->getOption('no-install'))
|
||||
->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies)
|
||||
->setIgnorePlatformRequirements($ignorePlatformReqs)
|
||||
|
|
|
@ -211,7 +211,7 @@ EOT
|
|||
->setOptimizeAutoloader($optimize)
|
||||
->setClassMapAuthoritative($authoritative)
|
||||
->setApcuAutoloader($apcu)
|
||||
->setUpdate(true)
|
||||
->setUpdate()
|
||||
->setInstall(!$input->getOption('no-install'))
|
||||
->setUpdateMirrors($updateMirrors)
|
||||
->setUpdateAllowList($packages)
|
||||
|
@ -284,7 +284,7 @@ EOT
|
|||
if ($io->askConfirmation(sprintf(
|
||||
'Would you like to continue and update the above package%s [<comment>yes</comment>]? ',
|
||||
1 === count($packages) ? '' : 's'
|
||||
), true)) {
|
||||
))) {
|
||||
return $packages;
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ EOT
|
|||
{
|
||||
$parser = new VersionParser;
|
||||
$oldPrettyString = $link->getConstraint()->getPrettyString();
|
||||
$newConstraint = MultiConstraint::create(array($link->getConstraint(), $parser->parseConstraints($constraint)), true);
|
||||
$newConstraint = MultiConstraint::create(array($link->getConstraint(), $parser->parseConstraints($constraint)));
|
||||
$newConstraint->setPrettyString($oldPrettyString.', '.$constraint);
|
||||
return new Link(
|
||||
$link->getSource(),
|
||||
|
|
|
@ -171,7 +171,7 @@ class Application extends BaseApplication
|
|||
// abort when we reach the home dir or top of the filesystem
|
||||
while (dirname($dir) !== $dir && $dir !== $home) {
|
||||
if (file_exists($dir.'/'.Factory::getComposerFile())) {
|
||||
if ($io->askConfirmation('<info>No composer.json in current directory, do you want to use the one at '.$dir.'?</info> [<comment>Y,n</comment>]? ', true)) {
|
||||
if ($io->askConfirmation('<info>No composer.json in current directory, do you want to use the one at '.$dir.'?</info> [<comment>Y,n</comment>]? ')) {
|
||||
$oldWorkingDir = getcwd();
|
||||
chdir($dir);
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ class Application extends BaseApplication
|
|||
$io->writeError('<warning>Do not run Composer as root/super user! See https://getcomposer.org/root for details</warning>');
|
||||
|
||||
if ($io->isInteractive()) {
|
||||
if (!$io->askConfirmation('<info>Continue as root/super user</info> [<comment>yes</comment>]? ', true)) {
|
||||
if (!$io->askConfirmation('<info>Continue as root/super user</info> [<comment>yes</comment>]? ')) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ class Application extends BaseApplication
|
|||
|
||||
$composer = $this->getComposer(false, false);
|
||||
if (null === $composer) {
|
||||
$composer = Factory::createGlobal($this->io, false);
|
||||
$composer = Factory::createGlobal($this->io);
|
||||
}
|
||||
|
||||
if (null !== $composer) {
|
||||
|
|
|
@ -173,6 +173,6 @@ class RuleSet implements \IteratorAggregate, \Countable
|
|||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getPrettyString(null, null, null);
|
||||
return $this->getPrettyString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ class DownloadManager
|
|||
throw $e;
|
||||
}
|
||||
$this->io->writeError('<error> Update failed ('.$e->getMessage().')</error>');
|
||||
if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [<comment>yes</comment>]? ', true)) {
|
||||
if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [<comment>yes</comment>]? ')) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ class PerforceDownloader extends VcsDownloader
|
|||
*/
|
||||
public function getLocalChanges(PackageInterface $package, $path)
|
||||
{
|
||||
$this->io->writeError('Perforce driver does not check for local changes before overriding', true);
|
||||
$this->io->writeError('Perforce driver does not check for local changes before overriding');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -271,9 +271,9 @@ abstract class BaseIO implements IOInterface
|
|||
public function log($level, $message, array $context = array())
|
||||
{
|
||||
if (in_array($level, array(LogLevel::EMERGENCY, LogLevel::ALERT, LogLevel::CRITICAL, LogLevel::ERROR))) {
|
||||
$this->writeError('<error>'.$message.'</error>', true, self::NORMAL);
|
||||
$this->writeError('<error>'.$message.'</error>');
|
||||
} elseif ($level === LogLevel::WARNING) {
|
||||
$this->writeError('<warning>'.$message.'</warning>', true, self::NORMAL);
|
||||
$this->writeError('<warning>'.$message.'</warning>');
|
||||
} elseif ($level === LogLevel::NOTICE) {
|
||||
$this->writeError('<info>'.$message.'</info>', true, self::VERBOSE);
|
||||
} elseif ($level === LogLevel::INFO) {
|
||||
|
|
|
@ -73,7 +73,7 @@ class BufferIO extends ConsoleIO
|
|||
|
||||
private function createStream(array $inputs)
|
||||
{
|
||||
$stream = fopen('php://memory', 'r+', false);
|
||||
$stream = fopen('php://memory', 'r+');
|
||||
|
||||
foreach ($inputs as $input) {
|
||||
fwrite($stream, $input.PHP_EOL);
|
||||
|
|
|
@ -568,7 +568,7 @@ class Installer
|
|||
$repositorySet = $this->createRepositorySet(true, $platformRepo, $aliases);
|
||||
$repositorySet->addRepository($resultRepo);
|
||||
|
||||
$request = $this->createRequest($this->fixedRootPackage, $platformRepo, null);
|
||||
$request = $this->createRequest($this->fixedRootPackage, $platformRepo);
|
||||
|
||||
$links = $this->package->getRequires();
|
||||
foreach ($links as $link) {
|
||||
|
@ -996,7 +996,7 @@ class Installer
|
|||
if (!$this->optimizeAutoloader) {
|
||||
// Force classMapAuthoritative off when not optimizing the
|
||||
// autoloader
|
||||
$this->setClassMapAuthoritative(false);
|
||||
$this->setClassMapAuthoritative();
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -230,7 +230,7 @@ class InstallationManager
|
|||
|
||||
exit(130);
|
||||
};
|
||||
sapi_windows_set_ctrl_handler($windowsHandler, true);
|
||||
sapi_windows_set_ctrl_handler($windowsHandler);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -385,7 +385,7 @@ class JsonManipulator
|
|||
if ($subName !== null) {
|
||||
$curVal = json_decode($matches['content'], true);
|
||||
unset($curVal[$name][$subName]);
|
||||
$childrenClean = $that->format($curVal, 0);
|
||||
$childrenClean = $that->format($curVal);
|
||||
}
|
||||
|
||||
return $matches['start'] . $childrenClean . $matches['end'];
|
||||
|
|
|
@ -637,7 +637,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
|||
}
|
||||
|
||||
// load acceptable packages in the providers
|
||||
$loadedPackages = $this->createPackages($versionsToLoad, 'Composer\Package\CompletePackage');
|
||||
$loadedPackages = $this->createPackages($versionsToLoad);
|
||||
$uids = array_keys($versionsToLoad);
|
||||
|
||||
foreach ($loadedPackages as $index => $package) {
|
||||
|
@ -667,7 +667,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
|||
|
||||
$repoData = $this->loadDataFromServer();
|
||||
|
||||
foreach ($this->createPackages($repoData, 'Composer\Package\CompletePackage') as $package) {
|
||||
foreach ($this->createPackages($repoData) as $package) {
|
||||
$this->addPackage($package);
|
||||
}
|
||||
}
|
||||
|
@ -764,7 +764,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
|||
}
|
||||
}
|
||||
|
||||
$loadedPackages = $repo->createPackages($versionsToLoad, 'Composer\Package\CompletePackage');
|
||||
$loadedPackages = $repo->createPackages($versionsToLoad);
|
||||
foreach ($loadedPackages as $package) {
|
||||
$package->setRepository($repo);
|
||||
$packages[spl_object_hash($package)] = $package;
|
||||
|
|
|
@ -207,7 +207,7 @@ class Svn
|
|||
$this->credentials['username'] = $this->io->ask("Username: ");
|
||||
$this->credentials['password'] = $this->io->askAndHideAnswer("Password: ");
|
||||
|
||||
$this->cacheCredentials = $this->io->askConfirmation("Should Subversion cache these credentials? (yes/no) ", true);
|
||||
$this->cacheCredentials = $this->io->askConfirmation("Should Subversion cache these credentials? (yes/no) ");
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue