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

Prevent off-by-one errors in line-number related methods #985

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Mar 13, 2024

when working with line numbers, one could easily do off-by-one errors because of assumptions about whether line numbers start at 0 or 1.

the added phpdocs make sure that static analysis, no matter whether phpstan or psalm, can detect errors like that. psalm will also work with these phpstan-prefixed phpdocs.

@staabm staabm changed the title Prevent off-by-one errors in line-numer related methods Prevent off-by-one errors in line-number related methods Mar 13, 2024
@staabm staabm marked this pull request as ready for review March 13, 2024 10:55
@nikic nikic merged commit 09691fc into nikic:master Mar 13, 2024
9 checks passed
@staabm staabm deleted the non-zero-line branch March 13, 2024 19:33
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.

None yet

3 participants