From f435618cb3dfb6024030c6192ec46fffe941195f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 27 Apr 2022 21:54:54 +0200 Subject: [PATCH] Update phpstan baseline (2086, 104) --- phpstan/baseline.neon | 39 +++++++++++++++----------- src/Composer/Command/ConfigCommand.php | 2 +- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/phpstan/baseline.neon b/phpstan/baseline.neon index 760111d2a..522d6ce34 100644 --- a/phpstan/baseline.neon +++ b/phpstan/baseline.neon @@ -400,11 +400,6 @@ parameters: count: 1 path: ../src/Composer/Command/ConfigCommand.php - - - message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" - count: 1 - path: ../src/Composer/Command/ConfigCommand.php - - message: "#^Only booleans are allowed in an elseif condition, int\\<0, max\\>\\|false given\\.$#" count: 1 @@ -415,11 +410,6 @@ parameters: count: 1 path: ../src/Composer/Command/ConfigCommand.php - - - message: "#^Parameter \\#1 \\$command of function escapeshellcmd expects string, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/ConfigCommand.php - - message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{Composer\\\\Config\\\\JsonConfigSource, string\\} given\\.$#" count: 2 @@ -670,6 +660,11 @@ parameters: count: 1 path: ../src/Composer/Command/InitCommand.php + - + message: "#^Left side of && is always false\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + - message: "#^Method Composer\\\\Command\\\\InitCommand\\:\\:getGitConfig\\(\\) should return array\\ but returns array\\\\.$#" count: 1 @@ -710,6 +705,11 @@ parameters: count: 1 path: ../src/Composer/Command/InitCommand.php + - + message: "#^Right side of && is always false\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + - message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" count: 8 @@ -780,6 +780,11 @@ parameters: count: 3 path: ../src/Composer/Command/RequireCommand.php + - + message: "#^Left side of && is always true\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + - message: "#^Method Composer\\\\Command\\\\RequireCommand\\:\\:getPackagesByRequireKey\\(\\) should return array\\ but returns array\\\\.$#" count: 1 @@ -820,6 +825,11 @@ parameters: count: 1 path: ../src/Composer/Command/RequireCommand.php + - + message: "#^Right side of && is always true\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + - message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" count: 1 @@ -4260,7 +4270,7 @@ parameters: - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 5 + count: 4 path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php - @@ -4540,7 +4550,7 @@ parameters: - message: "#^Cannot call method write\\(\\) on Composer\\\\Cache\\|null\\.$#" - count: 1 + count: 2 path: ../src/Composer/Repository/Vcs/SvnDriver.php - @@ -5233,11 +5243,6 @@ parameters: count: 2 path: ../src/Composer/Util/HttpDownloader.php - - - message: "#^Offset 'curl_id' on array\\{curl_id\\: int, exception\\: Composer\\\\Downloader\\\\TransportException, id\\: int, origin\\: string, reject\\: mixed, request\\: array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}, resolve\\: mixed, response\\: Composer\\\\Util\\\\Http\\\\Response, \\.\\.\\.\\} in isset\\(\\) always exists and is not nullable\\.$#" - count: 1 - path: ../src/Composer/Util/HttpDownloader.php - - message: "#^Offset 'exception' does not exist on array\\{id\\: int, status\\: 4, request\\: array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}, sync\\: bool, origin\\: string, resolve\\?\\: callable\\(\\)\\: mixed, reject\\?\\: callable\\(\\)\\: mixed, curl_id\\?\\: int, \\.\\.\\.\\}\\.$#" count: 1 diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index cf3bd4298..390cf2969 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -215,7 +215,7 @@ EOT // Open file in editor if (true === $input->getOption('editor')) { $editor = Platform::getEnv('EDITOR'); - if (!$editor) { + if (false === $editor || '' === $editor) { if (Platform::isWindows()) { $editor = 'notepad'; } else {