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

Use InvalidScalarArgument only when we can be sure PHP attempts coercion #7188

Merged
merged 3 commits into from Jan 3, 2022

Conversation

muglug
Copy link
Collaborator

@muglug muglug commented Dec 19, 2021

This is an alternative to #7181

It narrows the occasions where InvalidScalarArgument is emitted to only the places where we're sure that PHP will attempt to coerce one scalar type to another. This matches the original intent of InvalidScalarArgument — a lesser issue than InvalidArgument, for when the PHP runtime may not care.

@muglug muglug added the release:fix The PR will be included in 'Fixes' section of the release notes label Dec 19, 2021
@muglug muglug force-pushed the muglug-use-invalidscalarargument-less branch from 78450c2 to 87a7a88 Compare December 19, 2021 11:17
@orklah
Copy link
Collaborator

orklah commented Dec 19, 2021

This would make sense. It would be great to document this somewhere. Maybe a comment on the scalar_type_match_found property and an explanation in the Issue page?

@orklah
Copy link
Collaborator

orklah commented Dec 23, 2021

@weirdan should we merge this now or is it something we will add to Psalm 5?

@weirdan
Copy link
Collaborator

weirdan commented Dec 23, 2021

is it something we will add to Psalm 5?

That would be my preference, yes.

@weirdan weirdan added this to the Psalm 5 milestone Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants