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

Conversation

janbarasek
Copy link
Contributor

Bugfix of return type error.

The SimpleArithmeticExpression() method can also return an ArithmeticTerm type that is not defined in the annotation.

Example:

Snímek obrazovky 2022-03-02 v 14 13 59

@derrabus derrabus added this to the 2.11.2 milestone Mar 2, 2022
@derrabus
Copy link
Member

derrabus commented Mar 2, 2022

Can you please update the baselines of Psalm and PHPStan?

@janbarasek
Copy link
Contributor Author

@derrabus I tried to fix the baseline. Please enable the tests. Thank you.

@derrabus
Copy link
Member

derrabus commented Mar 2, 2022

Both baselines are generated files. Don't edit them manually.

./vendor/bin/phpstan --generate-baseline
./vendor/bin/psalm --no-cache --set-baseline=psalm-baseline.xml

@janbarasek
Copy link
Contributor Author

I successfully updated the Psalm baseline and PhpStan did not need to make any changes:

Snímek obrazovky 2022-03-02 v 18 22 02

psalm-baseline.xml Outdated Show resolved Hide resolved
@derrabus
Copy link
Member

derrabus commented Mar 2, 2022

Sorry for the trouble with our tooling. But fixing doc blocks in most cases means that static analysis will report less different errors, so we have to review and adjust the baselines.

Your fix is certainly correct. I've reviewed the return types on Parser and some AST classes recently and found a lot more inaccurate annotations. If you continue to work with the parser, please take all annotations with a grain of salt. 😕

@derrabus derrabus enabled auto-merge (squash) March 2, 2022 17:38
@janbarasek janbarasek requested a review from derrabus March 2, 2022 17:46
@derrabus derrabus merged commit 38682e9 into doctrine:2.11.x Mar 2, 2022
derrabus added a commit that referenced this pull request Mar 3, 2022
* 2.11.x:
  Parser: SimpleArithmeticExpression should return ArithmeticTerm (#9557)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants