From faf4a3529a95ec83b89e3736417c7d094b688186 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 29 Nov 2020 23:21:48 +0100 Subject: [PATCH] Fix PHPStan configuration --- phpstan-baseline.neon | 39 ++++++++++++++++++++++----------------- phpstan.neon.dist | 1 - 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1c831e37ce..37516471fd 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,22 +1,27 @@ parameters: - ignoreErrors: - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$applyFilters$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php + ignoreErrors: + # Adding a parameter would be BC-break + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$applyFilters$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php + # Making classes final as suggested would be a BC-break + - + message: "#^Unsafe usage of new static\\(\\)\\.$#" + paths: + - lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php + - lib/Doctrine/ODM/MongoDB/DocumentManager.php - - - message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\:\\:limit\\(\\) should be compatible with return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Limit\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\:\\:limit\\(\\)$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php + # The limit option in GeoNear has been removed in MongoDB 4.2 in favor of $limit stage + - + message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\:\\:limit\\(\\) should be compatible with return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Limit\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\:\\:limit\\(\\)$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: lib/Doctrine/ODM/MongoDB/DocumentManager.php + # Union types cannot be added yet + - + message: "#^Result of && is always false\\.$#" + count: 1 + path: lib/Doctrine/ODM/MongoDB/Query/Builder.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e2f0532439..aee6fb665d 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,7 +2,6 @@ includes: - phpstan-baseline.neon parameters: - treatPhpDocTypesAsCertain: false level: 5 paths: - %rootDir%/../../../benchmark