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

Incorrect errors after upgrading to 0.12.9 for php-decimal extension and stub #3482

Closed
maks-rafalko opened this issue Jun 16, 2020 · 9 comments

Comments

@maks-rafalko
Copy link
Contributor

Bug report

Code snippet that reproduces the problem

new Decimal(0);

Expected output (0.12.8)

no issue

Actual output (0.12.9)

Parameter #1 $value of class Decimal\Decimal constructor expects string, int given.

We are using stubs for Decimal\Decimal class, and it allows int:

https://github.com/php-decimal/stubs/blob/683b5c68b13c14373df9e835f98926c62c73c29d/Decimal.php#L30

I'm not sure PHPStan used this stub file before, or started using it after 0.12.9, but something has changed ;)

@mergeable
Copy link

mergeable bot commented Jun 16, 2020

This bug report is missing a link to reproduction on phpstan.org.
It will most likely be closed after manual review.

@maks-rafalko
Copy link
Contributor Author

This bug report is missing a link to reproduction on phpstan.org.

playground does not have needed extension, not applicable

@ondrejmirtes
Copy link
Member

Hi, do you mean PHPStan 0.12.29? It's reproducible in the playground (the loaded PHP extensions aren't necessary anymore): https://phpstan.org/r/3cafdef6-97f4-4bfc-93d2-3af9e82ad808

@ondrejmirtes
Copy link
Member

Sent a PR upstream: JetBrains/phpstorm-stubs#838

@ondrejmirtes
Copy link
Member

Please try dev-master of phpstan/phpstan to see if there are any more problems related to Decimal. This one is fixed:

Thank you.

@ondrejmirtes
Copy link
Member

@maks-rafalko
Copy link
Contributor Author

maks-rafalko commented Jun 16, 2020

Hi, do you mean PHPStan 0.12.29

yes, sorry, 0.12.29

Thanks!

@ondrejmirtes
Copy link
Member

Just PHPStan as it already depends on dev-master of phpstorm-stubs.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants