diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index fb1a83d3f..e4b7e40c0 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -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('Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? ', true) + || $io->askConfirmation('Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? ') ) ) { $finder = new Finder(); @@ -414,7 +414,7 @@ EOT $fs = new Filesystem(); $fs->removeDirectory($realDir); exit(130); - }, true); + }); } } diff --git a/src/Composer/Command/DependsCommand.php b/src/Composer/Command/DependsCommand.php index c350fde9b..5229a1e76 100644 --- a/src/Composer/Command/DependsCommand.php +++ b/src/Composer/Command/DependsCommand.php @@ -52,6 +52,6 @@ EOT */ protected function execute(InputInterface $input, OutputInterface $output) { - return parent::doExecute($input, $output, false); + return parent::doExecute($input, $output); } } diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 19812fcb0..d85622af5 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -124,7 +124,7 @@ EOT if ($input->isInteractive()) { $io->writeError(array('', $json, '')); - if (!$io->askConfirmation('Do you confirm generation [yes]? ', true)) { + if (!$io->askConfirmation('Do you confirm generation [yes]? ')) { $io->writeError('Command aborted'); return 1; @@ -143,14 +143,14 @@ EOT if (!$this->hasVendorIgnore($ignoreFile)) { $question = 'Would you like the vendor directory added to your .gitignore [yes]? '; - if ($io->askConfirmation($question, true)) { + if ($io->askConfirmation($question)) { $this->addVendorIgnore($ignoreFile); } } } $question = 'Would you like to install dependencies now [yes]? '; - 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 [yes]? '; $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 [yes]? '; $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); diff --git a/src/Composer/Command/RemoveCommand.php b/src/Composer/Command/RemoveCommand.php index 53c040412..d4597bc8c 100644 --- a/src/Composer/Command/RemoveCommand.php +++ b/src/Composer/Command/RemoveCommand.php @@ -158,7 +158,7 @@ EOT } elseif (isset($composer[$altType][$package])) { $io->writeError('' . $composer[$altType][$package] . ' could not be found in ' . $type . ' but it is present in ' . $altType . ''); if ($io->isInteractive()) { - if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [yes]? ', true)) { + if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [yes]? ')) { if ($dryRun) { $toRemove[$altType][] = $composer[$altType][$package]; } else { @@ -178,7 +178,7 @@ EOT foreach ($matches as $matchedPackage) { $io->writeError('' . $matchedPackage . ' could not be found in ' . $type . ' but it is present in ' . $altType . ''); if ($io->isInteractive()) { - if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [yes]? ', true)) { + if ($io->askConfirmation('Do you want to remove it from ' . $altType . ' [yes]? ')) { 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) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 9525b9e77..8e549063a 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -302,7 +302,7 @@ EOT ->setOptimizeAutoloader($optimize) ->setClassMapAuthoritative($authoritative) ->setApcuAutoloader($apcu) - ->setUpdate(true) + ->setUpdate() ->setInstall(!$input->getOption('no-install')) ->setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies) ->setIgnorePlatformRequirements($ignorePlatformReqs) diff --git a/src/Composer/Command/UpdateCommand.php b/src/Composer/Command/UpdateCommand.php index 809db532c..46bf62b50 100644 --- a/src/Composer/Command/UpdateCommand.php +++ b/src/Composer/Command/UpdateCommand.php @@ -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 [yes]? ', 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(), diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index c0be8d522..73779a563 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -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('No composer.json in current directory, do you want to use the one at '.$dir.'? [Y,n]? ', true)) { + if ($io->askConfirmation('No composer.json in current directory, do you want to use the one at '.$dir.'? [Y,n]? ')) { $oldWorkingDir = getcwd(); chdir($dir); } @@ -254,7 +254,7 @@ class Application extends BaseApplication $io->writeError('Do not run Composer as root/super user! See https://getcomposer.org/root for details'); if ($io->isInteractive()) { - if (!$io->askConfirmation('Continue as root/super user [yes]? ', true)) { + if (!$io->askConfirmation('Continue as root/super user [yes]? ')) { 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) { diff --git a/src/Composer/DependencyResolver/RuleSet.php b/src/Composer/DependencyResolver/RuleSet.php index 5de29bb51..5151b3d7e 100644 --- a/src/Composer/DependencyResolver/RuleSet.php +++ b/src/Composer/DependencyResolver/RuleSet.php @@ -173,6 +173,6 @@ class RuleSet implements \IteratorAggregate, \Countable public function __toString() { - return $this->getPrettyString(null, null, null); + return $this->getPrettyString(); } } diff --git a/src/Composer/Downloader/DownloadManager.php b/src/Composer/Downloader/DownloadManager.php index d9aca9bff..54c3d0e2f 100644 --- a/src/Composer/Downloader/DownloadManager.php +++ b/src/Composer/Downloader/DownloadManager.php @@ -313,7 +313,7 @@ class DownloadManager throw $e; } $this->io->writeError(' Update failed ('.$e->getMessage().')'); - if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [yes]? ', true)) { + if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [yes]? ')) { throw $e; } } diff --git a/src/Composer/Downloader/PerforceDownloader.php b/src/Composer/Downloader/PerforceDownloader.php index 8be866929..f5965f0d7 100644 --- a/src/Composer/Downloader/PerforceDownloader.php +++ b/src/Composer/Downloader/PerforceDownloader.php @@ -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'); } /** diff --git a/src/Composer/IO/BaseIO.php b/src/Composer/IO/BaseIO.php index e3a263301..e66360edc 100644 --- a/src/Composer/IO/BaseIO.php +++ b/src/Composer/IO/BaseIO.php @@ -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(''.$message.'', true, self::NORMAL); + $this->writeError(''.$message.''); } elseif ($level === LogLevel::WARNING) { - $this->writeError(''.$message.'', true, self::NORMAL); + $this->writeError(''.$message.''); } elseif ($level === LogLevel::NOTICE) { $this->writeError(''.$message.'', true, self::VERBOSE); } elseif ($level === LogLevel::INFO) { diff --git a/src/Composer/IO/BufferIO.php b/src/Composer/IO/BufferIO.php index db4671341..e35918bfc 100644 --- a/src/Composer/IO/BufferIO.php +++ b/src/Composer/IO/BufferIO.php @@ -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); diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 5280a6451..99e15758d 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -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; diff --git a/src/Composer/Installer/InstallationManager.php b/src/Composer/Installer/InstallationManager.php index 62b0cade4..a4c919b57 100644 --- a/src/Composer/Installer/InstallationManager.php +++ b/src/Composer/Installer/InstallationManager.php @@ -230,7 +230,7 @@ class InstallationManager exit(130); }; - sapi_windows_set_ctrl_handler($windowsHandler, true); + sapi_windows_set_ctrl_handler($windowsHandler); } try { diff --git a/src/Composer/Json/JsonManipulator.php b/src/Composer/Json/JsonManipulator.php index 8ab6b33f5..ae9c95ce5 100644 --- a/src/Composer/Json/JsonManipulator.php +++ b/src/Composer/Json/JsonManipulator.php @@ -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']; diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 675c55626..d64d3e6e6 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -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; diff --git a/src/Composer/Util/Svn.php b/src/Composer/Util/Svn.php index 6d91016bd..6088d0c5f 100644 --- a/src/Composer/Util/Svn.php +++ b/src/Composer/Util/Svn.php @@ -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; }