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

Immediately called function without implicit throw broken for first class callable #3016

Conversation

janedbal
Copy link
Contributor

@janedbal janedbal commented Apr 16, 2024

Looks like it got broken in this commit. Checked by:

wget https://raw.githubusercontent.com/janedbal/phpstan-src/fd32899a00a58fea6e8db47356f97619c5906b11/tests/PHPStan/Analyser/data/immediately-called-function-without-implicit-throw.php

git checkout 925c0b7343eef8e86d4c65c5d2cd3fe5a65aca9b
bin/phpstan analyse -l 9 -c tests/PHPStan/Rules/Exceptions/data/ability-to-disable-implicit-throws.neon immediately-called-function-without-implicit-throw.php
# no errors

git checkout 8a8b712ff038df9ebea57f16a9e81f777870fe49
bin/phpstan analyse -l 9 -c tests/PHPStan/Rules/Exceptions/data/ability-to-disable-implicit-throws.neon immediately-called-function-without-implicit-throw.php
# error at line 11: Expected variable certainty Yes, actual: Maybe

Commits around that: https://github.com/phpstan/phpstan-src/commits/1.11.x/?after=f280c25a28e8fdf9853165324e8672c06065f8a8+139

@ondrejmirtes ondrejmirtes force-pushed the immediately-called-function-without-implicit-throw branch from fd32899 to 71b4ffa Compare April 19, 2024 08:54
@ondrejmirtes ondrejmirtes merged commit e956fad into phpstan:1.11.x Apr 19, 2024
82 checks passed
@ondrejmirtes
Copy link
Member

Fixed, thanks

@janedbal
Copy link
Contributor Author

Looks like this fix didnt make it to stable 1.11, why?

@ondrejmirtes
Copy link
Member

The log here in this PR says:

ondrejmirtes merged commit e956fad

And when I click on that commit it shows it's part of 1.11.0. What's the problem?

@janedbal
Copy link
Contributor Author

@janedbal
Copy link
Contributor Author

My bad, the behaviour stays only when implicitThrows is disabled. It is changed in 1.11 for default setup (implicitThrows being true). Ref: shipmonk-rnd/phpstan-rules#239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants