Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9c5157

Browse files
committed
Follow recommendation about multiline type
Apparently, there is consensus about multiline types between: - PHPStan - Psalm - Slevomat Coding Standard See slevomat/coding-standard#1586 (comment) 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.
1 parent 4aadba6 commit c9c5157

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

lib/Doctrine/ORM/Query/Parser.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,16 +2566,15 @@ public function ConditionalPrimary()
25662566
* EmptyCollectionComparisonExpression | CollectionMemberExpression |
25672567
* InstanceOfExpression
25682568
*
2569-
* @return AST\Node
2570-
* @psalm-return AST\BetweenExpression|
2569+
* @return (AST\BetweenExpression|
25712570
* AST\CollectionMemberExpression|
25722571
* AST\ComparisonExpression|
25732572
* AST\EmptyCollectionComparisonExpression|
25742573
* AST\ExistsExpression|
25752574
* AST\InExpression|
25762575
* AST\InstanceOfExpression|
25772576
* AST\LikeExpression|
2578-
* AST\NullComparisonExpression
2577+
* AST\NullComparisonExpression)
25792578
*/
25802579
public function SimpleConditionalExpression()
25812580
{

psalm-baseline.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,19 +2008,10 @@
20082008
<code>$factors[0]</code>
20092009
<code>$primary</code>
20102010
<code>$terms[0]</code>
2011-
<code><![CDATA[$this->CollectionMemberExpression()]]></code>
2012-
<code><![CDATA[$this->ComparisonExpression()]]></code>
2013-
<code><![CDATA[$this->EmptyCollectionComparisonExpression()]]></code>
2014-
<code><![CDATA[$this->ExistsExpression()]]></code>
2015-
<code><![CDATA[$this->InExpression()]]></code>
2016-
<code><![CDATA[$this->InstanceOfExpression()]]></code>
2017-
<code><![CDATA[$this->LikeExpression()]]></code>
2018-
<code><![CDATA[$this->NullComparisonExpression()]]></code>
20192011
</InvalidReturnStatement>
20202012
<InvalidReturnType>
20212013
<code>AST\ArithmeticFactor</code>
20222014
<code>AST\ArithmeticTerm</code>
2023-
<code>AST\BetweenExpression|</code>
20242015
<code>AST\SimpleArithmeticExpression|AST\ArithmeticTerm</code>
20252016
</InvalidReturnType>
20262017
<InvalidStringClass>

0 commit comments

Comments
 (0)