From 9f9c2ea81ba6c20d55b7b0cdabf49b13faadc701 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 17 Sep 2022 18:49:51 +0200 Subject: [PATCH] Use PhpStan level 6 New baseline errors are array types that I prefer to leave alone, as well as one PhpStan bug: https://github.com/phpstan/phpstan/issues/4526 --- phpstan-baseline.neon | 120 ++++++++++++++++++++++++++++++++++++++++++ phpstan.neon.dist | 2 +- 2 files changed, 121 insertions(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 488a8548b5..46662369fb 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,10 +1,100 @@ parameters: ignoreErrors: + - + message: "#^Method PhpParser\\\\Builder\\\\ClassConst\\:\\:__construct\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/Builder/ClassConst.php + + - + message: "#^Method PhpParser\\\\Builder\\\\ClassConst\\:\\:addConst\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/Builder/ClassConst.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:args\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:attribute\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:classConst\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:funcCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:methodCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:new\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:staticCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderFactory\\:\\:val\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderFactory.php + + - + message: "#^Method PhpParser\\\\BuilderHelpers\\:\\:normalizeValue\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/BuilderHelpers.php + + - + message: "#^Method PhpParser\\\\ConstExprEvaluator\\:\\:evaluateArray\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/ConstExprEvaluator.php + - message: "#^Unary operation \"~\" on mixed results in an error\\.$#" count: 1 path: lib/PhpParser/ConstExprEvaluator.php + - + message: "#^Method PhpParser\\\\Internal\\\\TokenPolyfill\\:\\:fixupBadCharacters\\(\\) has parameter \\$origTokens with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/Internal/TokenPolyfill.php + + - + message: "#^Method PhpParser\\\\Internal\\\\TokenPolyfill\\:\\:fixupBadCharacters\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/Internal/TokenPolyfill.php + + - + message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeArray\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/JsonDecoder.php + + - + message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeArray\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/JsonDecoder.php + + - + message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeComment\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/JsonDecoder.php + + - + message: "#^Method PhpParser\\\\JsonDecoder\\:\\:decodeNode\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/JsonDecoder.php + - message: "#^Call to function assert\\(\\) with false will always evaluate to false\\.$#" count: 1 @@ -15,6 +105,31 @@ parameters: count: 1 path: lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php + - + message: "#^Method PhpParser\\\\NodeDumper\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/NodeDumper.php + + - + message: "#^Method PhpParser\\\\NodeDumper\\:\\:dump\\(\\) has parameter \\$node with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/NodeDumper.php + + - + message: "#^Method PhpParser\\\\NodeDumper\\:\\:dumpRecursive\\(\\) has parameter \\$node with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/NodeDumper.php + + - + message: "#^Method PhpParser\\\\NodeTraverser\\:\\:traverseArray\\(\\) has parameter \\$nodes with no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/NodeTraverser.php + + - + message: "#^Method PhpParser\\\\NodeTraverser\\:\\:traverseArray\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: lib/PhpParser/NodeTraverser.php + - message: "#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$attrGroups\\.$#" count: 1 @@ -130,6 +245,11 @@ parameters: count: 1 path: lib/PhpParser/ParserAbstract.php + - + message: "#^Property PhpParser\\\\ParserAbstract\\:\\:\\$createdArrays \\(SplObjectStorage\\\\|null\\) does not accept SplObjectStorage\\\\.$#" + count: 1 + path: lib/PhpParser/ParserAbstract.php + - message: "#^Unary operation \"\\+\" on string results in an error\\.$#" count: 1 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8e67545bd9..af91012549 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,7 +2,7 @@ includes: - phpstan-baseline.neon parameters: - level: 5 + level: 6 paths: - lib treatPhpDocTypesAsCertain: false