From 91defd0bff298ee715b322b830e289a6ceb13543 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 5 Aug 2022 18:21:41 +0200 Subject: [PATCH] Fix build --- composer.json | 2 +- phpstan-baseline.neon | 28 ++++++++++++++-------------- phpstan-dbal2.neon | 10 +++++++++- psalm-baseline.xml | 13 +++++-------- psalm.xml | 15 +++++++++++++++ 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index 9ddd2078c19..512a9a666d7 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "squizlabs/php_codesniffer": "3.7.1", "symfony/cache": "^4.4 || ^5.4 || ^6.0", "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.25.0" + "vimeo/psalm": "4.26.0" }, "conflict": { "doctrine/annotations": "<1.13 || >= 2.0" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2380675292a..69bbe6cc8d9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -326,37 +326,37 @@ parameters: path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php - - message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddDaysExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddDaysExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php - - message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddHourExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddHourExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php - - message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMinutesExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMinutesExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php - - message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMonthExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddMonthExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php - - message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddSecondsExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddSecondsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php - - message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddWeeksExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddWeeksExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php - - message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddYearsExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateAddYearsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php @@ -366,37 +366,37 @@ parameters: path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php - - message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubDaysExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$days of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubDaysExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php - - message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubHourExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$hours of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubHourExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php - - message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMinutesExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$minutes of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMinutesExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php - - message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMonthExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$months of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubMonthExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php - - message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubSecondsExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$seconds of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubSecondsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php - - message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubWeeksExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$weeks of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubWeeksExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php - - message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubYearsExpression\\(\\) expects int, string given\\.$#" + message: "#^Parameter \\#2 \\$years of method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getDateSubYearsExpression\\(\\) expects int\\|numeric\\-string, string given\\.$#" count: 1 path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php diff --git a/phpstan-dbal2.neon b/phpstan-dbal2.neon index 65c354960d9..b262dad9f96 100644 --- a/phpstan-dbal2.neon +++ b/phpstan-dbal2.neon @@ -3,6 +3,8 @@ includes: - phpstan-params.neon parameters: + reportUnmatchedIgnoredErrors: false + ignoreErrors: # https://github.com/doctrine/collections/pull/282 - '/Variable \$offset in isset\(\) always exists and is not nullable\./' @@ -11,7 +13,7 @@ parameters: # Class name will change in DBAL 3. - '/^Class Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform not found\.$/' - # Forward compatibility for DBAL 3.2 + # Forward compatibility for DBAL 3.4 - '/^Call to an undefined method Doctrine\\DBAL\\Cache\\QueryCacheProfile::[gs]etResultCache\(\)\.$/' - message: '/^Call to an undefined static method Doctrine\\DBAL\\Configuration::[gs]etResultCache\(\)\.$/' @@ -19,6 +21,12 @@ parameters: - message: '/^Parameter #3 \$resultCache of class Doctrine\\DBAL\\Cache\\QueryCacheProfile constructor/' path: lib/Doctrine/ORM/AbstractQuery.php + - + message: '/^Parameter #2 \$\w+ of method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getDateAdd\w+Expression\(\) expects int, string given\.$/' + path: lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php + - + message: '/^Parameter #2 \$\w+ of method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getDateSub\w+Expression\(\) expects int, string given\.$/' + path: lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php # False positive - diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 58637bf0b16..10919a754e0 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + IterableResult @@ -1541,7 +1541,7 @@ - + $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) @@ -1549,7 +1549,7 @@ $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) - + $parser->ArithmeticPrimary() $parser->ArithmeticPrimary() @@ -1574,7 +1574,7 @@ - + $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) @@ -1582,7 +1582,7 @@ $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) $this->intervalExpression->dispatch($sqlWalker) - + $this->unit->value @@ -2777,9 +2777,6 @@ $this->getClassToExtend() ?: $metadata->name array_map('strlen', $paramTypes) - - ClassMetadataInfo::GENERATOR_TYPE_UUID - class_exists($metadata->name) diff --git a/psalm.xml b/psalm.xml index b8dfc1d5974..f4082fdf9a7 100644 --- a/psalm.xml +++ b/psalm.xml @@ -24,6 +24,11 @@ + + + + + @@ -42,6 +47,9 @@ + + + @@ -53,6 +61,8 @@ + + @@ -60,6 +70,11 @@ + + + + +