1
0
Fork 0

Fix lock:false still outputting lock file changes

pull/10768/head
Jordi Boggiano 2022-05-11 09:39:56 +02:00
parent c27dca83ef
commit 1d0fa93495
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 37 additions and 103 deletions

View File

@ -12,11 +12,6 @@ parameters:
- -
message: "#^Casting to bool something that's already bool\\.$#" message: "#^Casting to bool something that's already bool\\.$#"
count: 6
path: ../src/Composer/Autoload/AutoloadGenerator.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 1 count: 1
path: ../src/Composer/Autoload/AutoloadGenerator.php path: ../src/Composer/Autoload/AutoloadGenerator.php
@ -65,14 +60,9 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Autoload/AutoloadGenerator.php path: ../src/Composer/Autoload/AutoloadGenerator.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
path: ../src/Composer/Autoload/AutoloadGenerator.php
- -
message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" message: "#^Only booleans are allowed in a negated boolean, string given\\.$#"
count: 4 count: 3
path: ../src/Composer/Autoload/AutoloadGenerator.php path: ../src/Composer/Autoload/AutoloadGenerator.php
- -
@ -157,7 +147,7 @@ parameters:
- -
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 2 count: 1
path: ../src/Composer/Autoload/AutoloadGenerator.php path: ../src/Composer/Autoload/AutoloadGenerator.php
- -
@ -275,11 +265,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Autoload/ClassMapGenerator.php path: ../src/Composer/Autoload/ClassMapGenerator.php
-
message: "#^Casting to bool something that's already bool\\.$#"
count: 2
path: ../src/Composer/Cache.php
- -
message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" message: "#^Only booleans are allowed in a negated boolean, int given\\.$#"
count: 1 count: 1
@ -2475,11 +2460,6 @@ parameters:
count: 2 count: 2
path: ../src/Composer/Config.php path: ../src/Composer/Config.php
-
message: "#^Casting to bool something that's already bool\\.$#"
count: 1
path: ../src/Composer/Config.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
@ -3745,11 +3725,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/EventDispatcher/EventDispatcher.php path: ../src/Composer/EventDispatcher/EventDispatcher.php
-
message: "#^Casting to bool something that's already bool\\.$#"
count: 1
path: ../src/Composer/EventDispatcher/EventDispatcher.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1 count: 1
@ -4010,11 +3985,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Installer.php path: ../src/Composer/Installer.php
-
message: "#^Casting to bool something that's already bool\\.$#"
count: 15
path: ../src/Composer/Installer.php
- -
message: "#^Only booleans are allowed in &&, array\\<array\\<string, string\\>\\> given on the right side\\.$#" message: "#^Only booleans are allowed in &&, array\\<array\\<string, string\\>\\> given on the right side\\.$#"
count: 1 count: 1
@ -4025,6 +3995,11 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Installer.php path: ../src/Composer/Installer.php
-
message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#"
count: 1
path: ../src/Composer/Installer.php
- -
message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#"
count: 2 count: 2
@ -4075,6 +4050,11 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Installer.php path: ../src/Composer/Installer.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: ../src/Composer/Installer.php
- -
message: "#^Only booleans are allowed in \\|\\|, array\\<string\\>\\|null given on the left side\\.$#" message: "#^Only booleans are allowed in \\|\\|, array\\<string\\>\\|null given on the left side\\.$#"
count: 2 count: 2
@ -4445,11 +4425,6 @@ parameters:
count: 4 count: 4
path: ../src/Composer/Json/JsonManipulator.php path: ../src/Composer/Json/JsonManipulator.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 1
path: ../src/Composer/Json/JsonValidationException.php
- -
message: "#^Variable method call on Composer\\\\Package\\\\BasePackage\\.$#" message: "#^Variable method call on Composer\\\\Package\\\\BasePackage\\.$#"
count: 1 count: 1
@ -4625,21 +4600,11 @@ parameters:
count: 2 count: 2
path: ../src/Composer/Package/Dumper/ArrayDumper.php path: ../src/Composer/Package/Dumper/ArrayDumper.php
-
message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Package/Loader/ArrayLoader.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 10 count: 10
path: ../src/Composer/Package/Loader/ArrayLoader.php path: ../src/Composer/Package/Loader/ArrayLoader.php
-
message: "#^Instanceof between Composer\\\\Package\\\\CompletePackage and Composer\\\\Package\\\\CompletePackage will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Package/Loader/ArrayLoader.php
- -
message: "#^Instanceof between Composer\\\\Package\\\\CompletePackage and Composer\\\\Package\\\\CompletePackageInterface will always evaluate to true\\.$#" message: "#^Instanceof between Composer\\\\Package\\\\CompletePackage and Composer\\\\Package\\\\CompletePackageInterface will always evaluate to true\\.$#"
count: 1 count: 1
@ -4680,11 +4645,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Package/Loader/ArrayLoader.php path: ../src/Composer/Package/Loader/ArrayLoader.php
-
message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Package/Loader/JsonLoader.php
- -
message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFile\\:\\:parseJson\\(\\) expects string\\|null, string\\|false given\\.$#" message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFile\\:\\:parseJson\\(\\) expects string\\|null, string\\|false given\\.$#"
count: 1 count: 1
@ -5120,11 +5080,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Plugin/PostFileDownloadEvent.php path: ../src/Composer/Plugin/PostFileDownloadEvent.php
-
message: "#^Casting to bool something that's already bool\\.$#"
count: 1
path: ../src/Composer/Question/StrictConfirmationQuestion.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2 count: 2
@ -5455,16 +5410,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Repository/FilesystemRepository.php path: ../src/Composer/Repository/FilesystemRepository.php
-
message: "#^Call to function is_array\\(\\) with array\\<string\\> will always evaluate to true\\.$#"
count: 2
path: ../src/Composer/Repository/FilterRepository.php
-
message: "#^Call to function is_bool\\(\\) with bool will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Repository/FilterRepository.php
- -
message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#"
count: 1 count: 1
@ -6582,7 +6527,7 @@ parameters:
- -
message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#" message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#"
count: 4 count: 3
path: ../src/Composer/Util/Http/CurlDownloader.php path: ../src/Composer/Util/Http/CurlDownloader.php
- -
@ -6860,11 +6805,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Util/Http/RequestProxy.php path: ../src/Composer/Util/Http/RequestProxy.php
-
message: "#^Casting to int something that's already int\\.$#"
count: 1
path: ../src/Composer/Util/Http/Response.php
- -
message: "#^Anonymous function uses \\$this assigned to variable \\$downloader\\. Use \\$this directly in the function body\\.$#" message: "#^Anonymous function uses \\$this assigned to variable \\$downloader\\. Use \\$this directly in the function body\\.$#"
count: 2 count: 2
@ -7140,11 +7080,6 @@ parameters:
count: 1 count: 1
path: ../src/Composer/Util/Platform.php path: ../src/Composer/Util/Platform.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 1
path: ../src/Composer/Util/Platform.php
- -
message: "#^Only booleans are allowed in &&, array\\|false given on the left side\\.$#" message: "#^Only booleans are allowed in &&, array\\|false given on the left side\\.$#"
count: 1 count: 1
@ -8088,11 +8023,6 @@ parameters:
count: 4 count: 4
path: ../tests/Composer/Test/InstallerTest.php path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Call to function is_array\\(\\) with array\\<Composer\\\\Repository\\\\RepositoryInterface\\> will always evaluate to true\\.$#"
count: 1
path: ../tests/Composer/Test/InstallerTest.php
- -
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 9 count: 9

View File

@ -507,23 +507,25 @@ class Installer
} }
} }
$this->io->writeError(sprintf( if ($this->config->get('lock')) {
"<info>Lock file operations: %d install%s, %d update%s, %d removal%s</info>", $this->io->writeError(sprintf(
count($installNames), "<info>Lock file operations: %d install%s, %d update%s, %d removal%s</info>",
1 === count($installNames) ? '' : 's', count($installNames),
count($updateNames), 1 === count($installNames) ? '' : 's',
1 === count($updateNames) ? '' : 's', count($updateNames),
count($uninstalls), 1 === count($updateNames) ? '' : 's',
1 === count($uninstalls) ? '' : 's' count($uninstalls),
)); 1 === count($uninstalls) ? '' : 's'
if ($installNames) { ));
$this->io->writeError("Installs: ".implode(', ', $installNames), true, IOInterface::VERBOSE); if ($installNames) {
} $this->io->writeError("Installs: ".implode(', ', $installNames), true, IOInterface::VERBOSE);
if ($updateNames) { }
$this->io->writeError("Updates: ".implode(', ', $updateNames), true, IOInterface::VERBOSE); if ($updateNames) {
} $this->io->writeError("Updates: ".implode(', ', $updateNames), true, IOInterface::VERBOSE);
if ($uninstalls) { }
$this->io->writeError("Removals: ".implode(', ', $uninstallNames), true, IOInterface::VERBOSE); if ($uninstalls) {
$this->io->writeError("Removals: ".implode(', ', $uninstallNames), true, IOInterface::VERBOSE);
}
} }
} }
@ -550,8 +552,8 @@ class Installer
$this->suggestedPackagesReporter->addSuggestionsFromPackage($operation->getPackage()); $this->suggestedPackagesReporter->addSuggestionsFromPackage($operation->getPackage());
} }
// output op, but alias op only in debug verbosity // output op if lock file is enabled, but alias op only in debug verbosity
if (false === strpos($operation->getOperationType(), 'Alias') || $this->io->isDebug()) { if ($this->config->get('lock') && (false === strpos($operation->getOperationType(), 'Alias') || $this->io->isDebug())) {
$this->io->writeError(' - ' . $operation->show(true)); $this->io->writeError(' - ' . $operation->show(true));
} }
} }
@ -655,7 +657,9 @@ class Installer
*/ */
protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySolved = false) protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySolved = false)
{ {
$this->io->writeError('<info>Installing dependencies from lock file'.($this->devMode ? ' (including require-dev)' : '').'</info>'); if ($this->config->get('lock')) {
$this->io->writeError('<info>Installing dependencies from lock file'.($this->devMode ? ' (including require-dev)' : '').'</info>');
}
$lockedRepository = $this->locker->getLockedRepository($this->devMode); $lockedRepository = $this->locker->getLockedRepository($this->devMode);