`if.condNotBoolean` is not generated if variable is an item from an untyped array
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the PHPStan reproducer linked in the report and compare it with the typed-array reproducer, focusing on the behavior change since v2.1.30. The work is done when the untyped-array case also reports if.condNotBoolean while preserving the expected behavior shown by the comparison link.
Written by the indexing model from the issue text.
Description
Bug report
Values taken from untyped arrays no longer generate if.condNotBoolean since v2.1.30.
Code snippet that reproduces the problem
https://phpstan.org/r/93a0d683-e507-4a8b-bb00-dfb88285b9f2
Expected output
I'd expect the snipped to generate if.condNotBoolean. Here is the equivalent snippet with the array type defined https://phpstan.org/r/12ec5066-dc65-4576-b588-6d642e0c45ee.
Did PHPStan help you today? Did it make you happy in any way?
It helped my refactor a bunch of weird legacy code without having to tear my hair out!
- Dominant language
- PHP
- Stars
- 711
- Forks
- 62
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phpstan/phpstan-strict-rules
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
phpstan/phpstan-strict-rules#317 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
phpstan/phpstan-strict-rules#316 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
phpstan/phpstan-strict-rules#298 · 2 comments · 1 reaction ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
phpstan/phpstan-strict-rules#283 · 6 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
phpstan/phpstan-strict-rules#276 · 2 comments ·
All issues in phpstan/phpstan-strict-rules
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
customer-support needs-triage Platform(Default)
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
grokability/snipe-it#19767 ·
Maintainers usually reply within 1 day
-
[Code Quality] SfxDownloader extract path has no destination-writability pre-check for cached zipsOpenpriority:low type:refactor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
crazy-goat/workerman-bundle#1052 ·
Maintainers usually reply within 1 day
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day