diff --git a/phpstan/baseline-8.1.neon b/phpstan/baseline-8.1.neon index 4d70346e0..bd3c458f2 100644 --- a/phpstan/baseline-8.1.neon +++ b/phpstan/baseline-8.1.neon @@ -1,5 +1,10 @@ parameters: ignoreErrors: + - + message: "#^Casting to string something that's already string\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + - message: "#^Parameter \\#1 \\$callback of function spl_autoload_register expects \\(callable\\(string\\)\\: void\\)\\|null, array\\{\\$this\\(Composer\\\\Autoload\\\\ClassLoader\\), 'loadClass'\\} given\\.$#" count: 1 @@ -30,21 +35,6 @@ parameters: count: 1 path: ../src/Composer/Command/ExecCommand.php - - - message: "#^Parameter \\#1 \\$from of function rename expects string, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Parameter \\#1 \\$user_id of function posix_getpwuid expects int, int\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Parameter \\#2 \\$permissions of function chmod expects int, int\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\\\>\\|string given\\.$#" count: 1 @@ -65,11 +55,6 @@ parameters: count: 1 path: ../src/Composer/Command/ValidateCommand.php - - - message: "#^Parameter \\#1 \\$string of function rtrim expects string, int\\|string\\|null given\\.$#" - count: 1 - path: ../src/Composer/Config.php - - message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Composer\\\\Json\\\\JsonManipulator, string\\} given\\.$#" count: 1 @@ -195,6 +180,11 @@ parameters: count: 1 path: ../src/Composer/Util/AuthHelper.php + - + message: "#^Casting to string something that's already string\\.$#" + count: 4 + path: ../src/Composer/Util/Filesystem.php + - message: "#^Parameter \\#1 \\$string of function rawurlencode expects string, string\\|null given\\.$#" count: 15 diff --git a/phpstan/baseline.neon b/phpstan/baseline.neon index a530c9ddd..663276094 100644 --- a/phpstan/baseline.neon +++ b/phpstan/baseline.neon @@ -12,11 +12,6 @@ parameters: - 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 path: ../src/Composer/Autoload/AutoloadGenerator.php @@ -127,7 +122,7 @@ parameters: - message: "#^Parameter \\#1 \\$str of function strtr expects string, string\\|false given\\.$#" - count: 2 + count: 1 path: ../src/Composer/Autoload/AutoloadGenerator.php - @@ -160,11 +155,6 @@ parameters: count: 2 path: ../src/Composer/Autoload/AutoloadGenerator.php - - - message: "#^Strict comparison using \\!\\=\\= between string and false will always evaluate to true\\.$#" - count: 1 - path: ../src/Composer/Autoload/AutoloadGenerator.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 1 @@ -445,11 +435,6 @@ parameters: count: 2 path: ../src/Composer/Command/ConfigCommand.php - - - message: "#^Parameter \\#1 \\$path of function dirname expects string, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/ConfigCommand.php - - message: "#^Parameter \\#2 \\$rawContents of method Composer\\\\Command\\\\ConfigCommand\\:\\:listConfiguration\\(\\) expects array\\, array\\|string\\|null given\\.$#" count: 1 @@ -890,101 +875,16 @@ parameters: count: 1 path: ../src/Composer/Command/SearchCommand.php - - - message: "#^Call to function base64_decode\\(\\) requires parameter \\#2 to be set\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Cannot access offset 'name' on array\\|false\\.$#" - count: 2 - path: ../src/Composer/Command/SelfUpdateCommand.php - - message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" count: 1 path: ../src/Composer/Command/SelfUpdateCommand.php - - - message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" - count: 2 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" - count: 2 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Only booleans are allowed in an if condition, int\\<0, max\\> given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" - count: 6 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" count: 1 path: ../src/Composer/Command/SelfUpdateCommand.php - - - message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" - count: 2 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Parameter \\#1 \\$data of function openssl_verify expects string, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Parameter \\#1 \\$old_name of function rename expects string, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Parameter \\#1 \\$uid of function posix_getpwuid expects int, int\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Parameter \\#2 \\$except of method Composer\\\\Command\\\\SelfUpdateCommand\\:\\:cleanBackups\\(\\) expects string\\|null, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Parameter \\#2 \\$mode of function chmod expects int, int\\|false given\\.$#" - count: 1 - path: ../src/Composer/Command/SelfUpdateCommand.php - - - - message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" - count: 2 - path: ../src/Composer/Command/SelfUpdateCommand.php - - message: "#^Variable \\$match might not be defined\\.$#" count: 2 @@ -1485,11 +1385,6 @@ parameters: count: 1 path: ../src/Composer/Config.php - - - message: "#^Parameter \\#1 \\$str of function rtrim expects string, int\\|string\\|null given\\.$#" - count: 1 - path: ../src/Composer/Config.php - - message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" count: 1 @@ -2665,26 +2560,11 @@ parameters: count: 3 path: ../src/Composer/Factory.php - - - message: "#^Offset 'line' does not exist on array\\{text\\?\\: string, token\\?\\: string, line\\?\\: int, loc\\?\\: array\\{first_line\\: int, first_column\\: int, last_line\\: int, last_column\\: int\\}, expected\\?\\: array\\, key\\: string\\}\\.$#" - count: 1 - path: ../src/Composer/Factory.php - - - - message: "#^Only booleans are allowed in &&, Composer\\\\IO\\\\IOInterface\\|null given on the left side\\.$#" - count: 3 - path: ../src/Composer/Factory.php - - message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" count: 3 path: ../src/Composer/Factory.php - - - message: "#^Only booleans are allowed in an if condition, Composer\\\\IO\\\\IOInterface\\|null given\\.$#" - count: 1 - path: ../src/Composer/Factory.php - - message: "#^Only booleans are allowed in an if condition, Composer\\\\Util\\\\ProcessExecutor\\|null given\\.$#" count: 1 @@ -2700,11 +2580,6 @@ parameters: count: 6 path: ../src/Composer/Factory.php - - - message: "#^Parameter \\#1 \\$input of method Seld\\\\JsonLint\\\\JsonParser\\:\\:parse\\(\\) expects string, string\\|false given\\.$#" - count: 1 - path: ../src/Composer/Factory.php - - message: "#^Parameter \\#1 \\$path of class Composer\\\\Json\\\\JsonFile constructor expects string, string\\|false given\\.$#" count: 1 @@ -3920,11 +3795,6 @@ parameters: count: 1 path: ../src/Composer/Repository/ComposerRepository.php - - - message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:loadRootServerFile\\(\\) should return array\\ but returns array\\|true\\.$#" - count: 1 - path: ../src/Composer/Repository/ComposerRepository.php - - message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:whatProvides\\(\\) should return array\\ but returns array\\\\.$#" count: 1 @@ -4303,11 +4173,6 @@ parameters: count: 1 path: ../src/Composer/Repository/PlatformRepository.php - - - message: "#^Parameter \\#2 \\$prettyVersion of method Composer\\\\Repository\\\\PlatformRepository\\:\\:addLibrary\\(\\) expects string, string\\|null given\\.$#" - count: 3 - path: ../src/Composer/Repository/PlatformRepository.php - - message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" count: 3 @@ -4858,11 +4723,6 @@ parameters: count: 1 path: ../src/Composer/SelfUpdate/Keys.php - - - message: "#^Only booleans are allowed in a negated boolean, array\\\\>\\> given\\.$#" - count: 1 - path: ../src/Composer/SelfUpdate/Versions.php - - message: "#^Only booleans are allowed in an if condition, string given\\.$#" count: 1 @@ -4978,11 +4838,6 @@ parameters: count: 1 path: ../src/Composer/Util/ErrorHandler.php - - - message: "#^Casting to string something that's already string\\.$#" - count: 4 - path: ../src/Composer/Util/Filesystem.php - - message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" count: 1 @@ -5258,11 +5113,6 @@ parameters: count: 2 path: ../src/Composer/Util/Http/CurlDownloader.php - - - message: "#^Parameter \\#7 \\$attributes of method Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:initDownload\\(\\) expects array\\{retryAuthFailure\\?\\: bool, redirects\\?\\: int, retries\\?\\: int, storeAuth\\?\\: bool\\}, non\\-empty\\-array\\ given\\.$#" - count: 1 - path: ../src/Composer/Util/Http/CurlDownloader.php - - message: "#^Property Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:\\$jobs \\(array\\\\) does not accept non\\-empty\\-array\\\\.$#" count: 1 @@ -6018,16 +5868,6 @@ parameters: count: 2 path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php - - - message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, string\\|false given\\.$#" - count: 8 - path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php - - - - message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringNotContainsString\\(\\) expects string, string\\|false given\\.$#" - count: 3 - path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php - - message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:ensureDirectoryExistsAndClear\\(\\)\\.$#" count: 1