From 613980b0397b2df6d72beeef26f7f41c1d6490af Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Dec 2021 11:00:06 +0100 Subject: [PATCH] Update baseline --- phpstan/baseline.neon | 86 +++++++-------------------- src/Composer/Plugin/PluginManager.php | 2 +- 2 files changed, 24 insertions(+), 64 deletions(-) diff --git a/phpstan/baseline.neon b/phpstan/baseline.neon index e12d5eb91..af31ad97d 100644 --- a/phpstan/baseline.neon +++ b/phpstan/baseline.neon @@ -582,7 +582,7 @@ parameters: - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 4 + count: 2 path: ../src/Composer/Command/ConfigCommand.php - @@ -602,7 +602,7 @@ parameters: - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" - count: 12 + count: 11 path: ../src/Composer/Command/ConfigCommand.php - @@ -842,7 +842,7 @@ parameters: - message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" - count: 2 + count: 1 path: ../src/Composer/Command/DumpAutoloadCommand.php - @@ -860,11 +860,6 @@ parameters: count: 1 path: ../src/Composer/Command/DumpAutoloadCommand.php - - - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 1 - path: ../src/Composer/Command/DumpAutoloadCommand.php - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" count: 3 @@ -1192,7 +1187,7 @@ parameters: - message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" - count: 2 + count: 1 path: ../src/Composer/Command/InstallCommand.php - @@ -1212,7 +1207,7 @@ parameters: - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 4 + count: 3 path: ../src/Composer/Command/InstallCommand.php - @@ -1307,7 +1302,7 @@ parameters: - message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" - count: 2 + count: 1 path: ../src/Composer/Command/ReinstallCommand.php - @@ -1332,7 +1327,7 @@ parameters: - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 3 + count: 2 path: ../src/Composer/Command/ReinstallCommand.php - @@ -1362,7 +1357,7 @@ parameters: - message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" - count: 2 + count: 1 path: ../src/Composer/Command/RemoveCommand.php - @@ -1407,7 +1402,7 @@ parameters: - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 7 + count: 6 path: ../src/Composer/Command/RemoveCommand.php - @@ -1467,7 +1462,7 @@ parameters: - message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" - count: 3 + count: 2 path: ../src/Composer/Command/RequireCommand.php - @@ -1517,7 +1512,7 @@ parameters: - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 7 + count: 6 path: ../src/Composer/Command/RequireCommand.php - @@ -1655,16 +1650,6 @@ parameters: count: 1 path: ../src/Composer/Command/SearchCommand.php - - - message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" - count: 1 - path: ../src/Composer/Command/SearchCommand.php - - - - message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" - count: 1 - path: ../src/Composer/Command/SearchCommand.php - - message: "#^Call to function base64_decode\\(\\) requires parameter \\#2 to be set\\.$#" count: 1 @@ -2317,7 +2302,7 @@ parameters: - message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" - count: 2 + count: 1 path: ../src/Composer/Command/UpdateCommand.php - @@ -2342,7 +2327,7 @@ parameters: - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 6 + count: 5 path: ../src/Composer/Command/UpdateCommand.php - @@ -2500,11 +2485,6 @@ parameters: count: 1 path: ../src/Composer/Config.php - - - message: "#^Array \\(array\\\\) does not accept key \\(int\\|string\\)\\.$#" - count: 3 - path: ../src/Composer/Config.php - - message: "#^Array \\(array\\\\) does not accept key 0\\|string\\.$#" count: 1 @@ -2517,7 +2497,7 @@ parameters: - message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" - count: 4 + count: 2 path: ../src/Composer/Config.php - @@ -2960,19 +2940,9 @@ parameters: count: 3 path: ../src/Composer/DependencyResolver/Rule.php - - - message: "#^Cannot call method getPrettyConstraint\\(\\) on array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\\\|int\\<1, max\\>\\|string\\.$#" - count: 1 - path: ../src/Composer/DependencyResolver/Rule.php - - message: "#^Cannot call method getSource\\(\\) on array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\\\|int\\<1, max\\>\\|string\\.$#" - count: 2 - path: ../src/Composer/DependencyResolver/Rule.php - - - - message: "#^Cannot call method getTarget\\(\\) on array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\\\|int\\<1, max\\>\\|string\\.$#" - count: 5 + count: 1 path: ../src/Composer/DependencyResolver/Rule.php - @@ -5187,7 +5157,7 @@ parameters: - message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Composer\\|null given\\.$#" - count: 3 + count: 1 path: ../src/Composer/Plugin/PluginManager.php - @@ -5340,11 +5310,6 @@ parameters: count: 2 path: ../src/Composer/Repository/ComposerRepository.php - - - message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getPackageNames\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: ../src/Composer/Repository/ComposerRepository.php - - message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getProviderNames\\(\\) should return array\\ but returns array\\\\.$#" count: 1 @@ -5467,7 +5432,7 @@ parameters: - message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" - count: 14 + count: 13 path: ../src/Composer/Repository/ComposerRepository.php - @@ -5475,11 +5440,6 @@ parameters: count: 1 path: ../src/Composer/Repository/ComposerRepository.php - - - message: "#^Parameter \\#1 \\$input of function array_keys expects array, array\\\\|null given\\.$#" - count: 1 - path: ../src/Composer/Repository/ComposerRepository.php - - message: "#^Parameter \\#1 \\$input of function array_keys expects array, array\\\\>\\|null given\\.$#" count: 1 @@ -6097,7 +6057,7 @@ parameters: - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 6 + count: 7 path: ../src/Composer/Repository/Vcs/GitLabDriver.php - @@ -6150,6 +6110,11 @@ parameters: count: 1 path: ../src/Composer/Repository/Vcs/GitLabDriver.php + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + - message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" count: 3 @@ -8789,11 +8754,6 @@ parameters: count: 2 path: ../tests/Composer/Test/Repository/ArtifactRepositoryTest.php - - - message: "#^Parameter \\#4 \\$body of class Composer\\\\Util\\\\Http\\\\Response constructor expects string\\|null, string\\|false given\\.$#" - count: 6 - path: ../tests/Composer/Test/Repository/ComposerRepositoryTest.php - - message: "#^Cannot call method getName\\(\\) on Composer\\\\Package\\\\BasePackage\\|null\\.$#" count: 2 diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index adb769f83..c20d403fa 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -243,7 +243,7 @@ class PluginManager foreach ($map['files'] as $fileIdentifier => $file) { // exclude laminas/laminas-zendframework-bridge:src/autoload.php in versions <1.4.1 as it was broken on fresh installs // see https://github.com/composer/composer/issues/10349 - this hack can be removed once <1.4.1 releases stop being installed - if ($fileIdentifier === '7e9bd612cc444b3eed788ebbe46263a0' && $localRepo->findPackage('laminas/laminas-zendframework-bridge', '<1.4.1')) { + if ($fileIdentifier === '7e9bd612cc444b3eed788ebbe46263a0' && null !== $localRepo->findPackage('laminas/laminas-zendframework-bridge', '<1.4.1')) { continue; } \Composer\Autoload\composerRequire($fileIdentifier, $file);