Skip to content

[CLEANUP] Clean up ParserState a bit #1173

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 1 commit into from
Mar 16, 2025
Merged

Conversation

oliverklee
Copy link
Collaborator

No description provided.

@coveralls
Copy link

coveralls commented Mar 16, 2025

Coverage Status

coverage: 55.906% (+0.2%) from 55.727%
when pulling e04d9d4 on cleanup/annotations/parserstate
into e0e0dd3 on main.

@oliverklee oliverklee force-pushed the cleanup/annotations/parserstate branch 2 times, most recently from dd594f0 to 5aa7231 Compare March 16, 2025 12:51
@oliverklee oliverklee force-pushed the cleanup/annotations/parserstate branch from 5aa7231 to e04d9d4 Compare March 16, 2025 16:26
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.

LGTM, though I wonder if the return type for consumeComment should also be changed as part of this PR - ?

return $result;
}

/**
* @return ($string is non-empty-string ? non-empty-string : string)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know this was possible.

@oliverklee
Copy link
Collaborator Author

LGTM, though I wonder if the return type for consumeComment should also be changed as part of this PR - ?

Are you thinking of improving the type annotation, or are you thinking it of changing it from Comment|false to ?Comment?

@oliverklee
Copy link
Collaborator Author

Anyway, I have just created #1176 to use null as the "nothing" type instead.

@JakeQZ
Copy link
Collaborator

JakeQZ commented Mar 16, 2025

Are you thinking of improving the type annotation, or are you thinking it of changing it from Comment|false to ?Comment?

I added a review comment to the code, but it's disappeared (perhaps I forgot to click the 'Add review comment' button).

I was thinking it could be change to ?Comment, with null returned instead of false if there isn't a comment to consume.

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.

Since #1176 has been added to capture the outstanding issue, this can be merged.

@JakeQZ JakeQZ merged commit b3c1936 into main Mar 16, 2025
21 checks passed
@JakeQZ JakeQZ deleted the cleanup/annotations/parserstate branch March 16, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants