-
Notifications
You must be signed in to change notification settings - Fork 144
[TASK] Use native type declarations in ParserState
#1136
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
Conversation
fd02520
to
fb21800
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$offset
for strpos
can be negative. Otherwise changes look fine.
src/Parsing/ParserState.php
Outdated
* @param string $haystack | ||
* @param string $needle | ||
* @param int $offset | ||
* @param int<0, max> $offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$offset
can be negative to indicate an offset from the end of the string. (Note that the version of substr
provided in this class does not support a negative offset, whereas this method does because it calls on to the built-in PHP functions.)
fb21800
to
df757b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can lose the @param
in the DocBlock for $offset
now.
Co-authored-by: JakeQZ <[email protected]>
Part of #811