Skip to content

Fix false positives on non-existing-offset's#3868

Merged
ondrejmirtes merged 2 commits into
phpstan:2.1.xfrom
staabm:nonf
Mar 11, 2025
Merged

Fix false positives on non-existing-offset's#3868
ondrejmirtes merged 2 commits into
phpstan:2.1.xfrom
staabm:nonf

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Mar 10, 2025

as discussed in #3766 (comment) with this PR we detect some more array-dim fetch false-positive cases we see with reportPossiblyNonexistentGeneralArrayOffset.

closes phpstan/phpstan#11020

@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented Mar 10, 2025

CI errors seem unrelated, except in shipmonk-rnd/dead-code-detector in which we now correctly no longer emit an error and therfore the // @phpstan-ignore offsetAccess.notFound phpdocs no longer have an error to ignore

https://github.com/shipmonk-rnd/dead-code-detector/blob/c218837a440e69f6ac231fd2f3d0c514d02a241f/src/Provider/ReflectionUsageProvider.php#L113C59-L113C96
https://github.com/shipmonk-rnd/dead-code-detector/blob/c218837a440e69f6ac231fd2f3d0c514d02a241f/src/Provider/ReflectionUsageProvider.php#L143

@staabm staabm marked this pull request as ready for review March 10, 2025 14:54
@phpstan-bot
Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 54ca85b into phpstan:2.1.x Mar 11, 2025
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reportPossiblyNonexistentGeneralArrayOffset false positive

3 participants