Merge pull request #9165 from bpesch/master

Performance improvements
main
Jordi Boggiano 4 years ago committed by GitHub
commit 943c7a6433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -50,7 +50,6 @@ EOT
$requires = array();
if ($input->getOption('no-dev')) {
$installedRepo = $composer->getLocker()->getLockedRepository(!$input->getOption('no-dev'));
$dependencies = $installedRepo->getPackages();
} else {
$installedRepo = $composer->getRepositoryManager()->getLocalRepository();
// fallback to lockfile if installed repo is empty

@ -291,7 +291,7 @@ EOT
$value = $data;
} elseif (isset($data['config'][$settingKey])) {
$value = $this->config->get($settingKey, $input->getOption('absolute') ? 0 : Config::RELATIVE_PATHS);
} elseif (in_array($settingKey, $properties, true) && isset($rawData[$settingKey])) {
} elseif (isset($rawData[$settingKey]) && in_array($settingKey, $properties, true)) {
$value = $rawData[$settingKey];
} else {
throw new \RuntimeException($settingKey.' is not defined');

@ -423,7 +423,9 @@ EOT
$packageIsIgnored = \in_array($package->getPrettyName(), $ignoredPackages, true);
if ($input->getOption('outdated') && ($packageIsUpToDate || $packageIsIgnored)) {
continue;
} elseif ($input->getOption('outdated') || $input->getOption('strict')) {
}
if ($input->getOption('outdated') || $input->getOption('strict')) {
$hasOutdatedPackages = true;
}
@ -679,11 +681,7 @@ EOT
foreach ($package->getAutoload() as $type => $autoloads) {
$io->write('<comment>' . $type . '</comment>');
if ($type === 'psr-0') {
foreach ($autoloads as $name => $path) {
$io->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
}
} elseif ($type === 'psr-4') {
if ($type === 'psr-0' || $type === 'psr-4') {
foreach ($autoloads as $name => $path) {
$io->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
}

@ -121,7 +121,7 @@ EOT
}
if ($downloader instanceof VcsCapableDownloaderInterface) {
if ($currentRef = $downloader->getVcsReference($package, $targetDir)) {
if ($downloader->getVcsReference($package, $targetDir)) {
switch ($package->getInstallationSource()) {
case 'source':
$previousRef = $package->getSourceReference();

@ -83,7 +83,7 @@ EOT
// Determine output mode, default is by-package
$mode = SuggestedPackagesReporter::MODE_BY_PACKAGE;
$io = $this->getIO();
// if by-suggestion is given we override the default
if ($input->getOption('by-suggestion')) {
$mode = SuggestedPackagesReporter::MODE_BY_SUGGESTION;

@ -122,9 +122,8 @@ EOT
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'validate', $input, $output);
$eventCode = $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
$exitCode = max($eventCode, $exitCode);
return $exitCode;
return max($eventCode, $exitCode);
}
private function outputResult($io, $name, &$errors, &$warnings, $checkPublish = false, $publishErrors = array(), $checkLock = false, $lockErrors = array(), $printSchemaUrl = false)

Loading…
Cancel
Save