Skip to content

[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

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

oliverklee
Copy link
Collaborator

Part of #811

@oliverklee oliverklee self-assigned this Mar 11, 2025
@oliverklee oliverklee marked this pull request as draft March 11, 2025 08:36
@coveralls
Copy link

coveralls commented Mar 11, 2025

Coverage Status

coverage: 55.567%. remained the same
when pulling e71c3d7 on task/types/parser-state
into db8cad1 on main.

@oliverklee oliverklee force-pushed the task/types/parser-state branch 3 times, most recently from fd02520 to fb21800 Compare March 11, 2025 18:08
@oliverklee oliverklee marked this pull request as ready for review March 11, 2025 18:08
@oliverklee oliverklee requested a review from JakeQZ March 11, 2025 18:09
Copy link
Collaborator

@JakeQZ JakeQZ left a 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.

* @param string $haystack
* @param string $needle
* @param int $offset
* @param int<0, max> $offset
Copy link
Collaborator

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.)

@oliverklee oliverklee force-pushed the task/types/parser-state branch from fb21800 to df757b4 Compare March 11, 2025 18:56
@oliverklee oliverklee requested a review from JakeQZ March 11, 2025 18:57
Copy link
Collaborator

@JakeQZ JakeQZ left a 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.

@oliverklee oliverklee requested a review from JakeQZ March 11, 2025 19:32
@JakeQZ JakeQZ merged commit ff247ef into main Mar 11, 2025
21 checks passed
@JakeQZ JakeQZ deleted the task/types/parser-state branch March 11, 2025 20:15
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.

3 participants