Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser: SimpleArithmeticExpression should return ArithmeticTerm #9557

Merged
merged 5 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Query/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2809,7 +2809,7 @@ public function ArithmeticExpression()
/**
* SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
*
* @return SimpleArithmeticExpression
* @return SimpleArithmeticExpression|ArithmeticTerm
*/
public function SimpleArithmeticExpression()
{
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,6 @@ parameters:
count: 1
path: lib/Doctrine/ORM/Query/Parser.php

-
message: "#^Method Doctrine\\\\ORM\\\\Query\\\\Parser\\:\\:SimpleArithmeticExpression\\(\\) should return Doctrine\\\\ORM\\\\Query\\\\AST\\\\SimpleArithmeticExpression but returns Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticTerm\\|int\\|string\\.$#"
count: 1
path: lib/Doctrine/ORM/Query/Parser.php

-
message: """
#^PHPDoc tag @return has invalid value \\(AST\\\\BetweenExpression\\|
Expand Down
33 changes: 30 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@
<code>joinColumnName</code>
<code>joinColumnName</code>
</TooManyArguments>
<UndefinedMethod occurrences="1">
<code>isReadOnly</code>
</UndefinedMethod>
janbarasek marked this conversation as resolved.
Show resolved Hide resolved
</file>
<file src="lib/Doctrine/ORM/Mapping/ColumnResult.php">
<MissingConstructor occurrences="1">
Expand Down Expand Up @@ -1260,6 +1263,11 @@
<code>(string) $embeddedClass</code>
</RedundantCastGivenDocblockType>
</file>
<file src="lib/Doctrine/ORM/Mapping/ReflectionReadonlyProperty.php">
<UndefinedMethod occurrences="1">
<code>isReadOnly</code>
</UndefinedMethod>
</file>
<file src="lib/Doctrine/ORM/Mapping/SequenceGenerator.php">
<PossiblyNullPropertyAssignmentValue occurrences="1">
<code>$sequenceName</code>
Expand Down Expand Up @@ -1740,6 +1748,9 @@
</ParamNameMismatch>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="1">
<code>$simpleArithmeticExpression</code>
</PropertyNotSetInConstructor>
Expand Down Expand Up @@ -1862,6 +1873,9 @@
<PossiblyInvalidArgument occurrences="1">
<code>$this-&gt;simpleArithmeticExpression</code>
</PossiblyInvalidArgument>
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="2">
<code>$firstStringPrimary</code>
<code>$secondStringPrimary</code>
Expand All @@ -1886,6 +1900,10 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="2">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="2">
<code>$firstSimpleArithmeticExpression</code>
<code>$secondSimpleArithmeticExpression</code>
Expand All @@ -1900,11 +1918,18 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="1">
<code>$simpleArithmeticExpression</code>
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="2">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="2">
<code>$firstSimpleArithmeticExpression</code>
<code>$stringPrimary</code>
Expand Down Expand Up @@ -2333,7 +2358,7 @@
<code>AST\BetweenExpression|</code>
<code>ArithmeticFactor</code>
<code>ArithmeticTerm</code>
<code>SimpleArithmeticExpression</code>
<code>SimpleArithmeticExpression|ArithmeticTerm</code>
<code>string</code>
<code>string</code>
<code>string</code>
Expand Down Expand Up @@ -2378,10 +2403,11 @@
<PossiblyFalseArgument occurrences="1">
<code>strrpos($fromClassName, '\\')</code>
</PossiblyFalseArgument>
<PossiblyInvalidArgument occurrences="13">
<PossiblyInvalidArgument occurrences="14">
<code>$AST</code>
<code>$conditionalExpression</code>
<code>$expr</code>
<code>$pathExp</code>
<code>$stringExpr</code>
<code>$this-&gt;ConditionalExpression()</code>
<code>$this-&gt;ConditionalExpression()</code>
Expand All @@ -2393,9 +2419,10 @@
<code>$token['value']</code>
<code>$token['value']</code>
</PossiblyInvalidArgument>
<PossiblyInvalidPropertyAssignmentValue occurrences="3">
<PossiblyInvalidPropertyAssignmentValue occurrences="4">
<code>$this-&gt;ConditionalExpression()</code>
<code>$this-&gt;ConditionalExpression()</code>
<code>$this-&gt;SimpleArithmeticExpression()</code>
<code>$value</code>
</PossiblyInvalidPropertyAssignmentValue>
<PossiblyNullArgument occurrences="6">
Expand Down