From c9c5157fda047d66abfd381f82b18d0c42f6f435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 27 Jun 2023 22:58:40 +0200 Subject: [PATCH] Follow recommendation about multiline type Apparently, there is consensus about multiline types between: - PHPStan - Psalm - Slevomat Coding Standard See https://github.com/slevomat/coding-standard/issues/1586#issuecomment-1610195706 Using parenthesis is less ambiguous, it makes it clear to the parser where the type begins and where it ends. The change has a positive impact on the Psalm baseline, showing that psalm-return annotation was not really understood previously. --- lib/Doctrine/ORM/Query/Parser.php | 5 ++--- psalm-baseline.xml | 9 --------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 4cfe233a1ed..7e69b4865d0 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -2566,8 +2566,7 @@ public function ConditionalPrimary() * EmptyCollectionComparisonExpression | CollectionMemberExpression | * InstanceOfExpression * - * @return AST\Node - * @psalm-return AST\BetweenExpression| + * @return (AST\BetweenExpression| * AST\CollectionMemberExpression| * AST\ComparisonExpression| * AST\EmptyCollectionComparisonExpression| @@ -2575,7 +2574,7 @@ public function ConditionalPrimary() * AST\InExpression| * AST\InstanceOfExpression| * AST\LikeExpression| - * AST\NullComparisonExpression + * AST\NullComparisonExpression) */ public function SimpleConditionalExpression() { diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 249630341bb..e24083e4046 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -2008,19 +2008,10 @@ $factors[0] $primary $terms[0] - CollectionMemberExpression()]]> - ComparisonExpression()]]> - EmptyCollectionComparisonExpression()]]> - ExistsExpression()]]> - InExpression()]]> - InstanceOfExpression()]]> - LikeExpression()]]> - NullComparisonExpression()]]> AST\ArithmeticFactor AST\ArithmeticTerm - AST\BetweenExpression| AST\SimpleArithmeticExpression|AST\ArithmeticTerm