Skip to content

Conversation

VincentLanglet
Copy link
Contributor

Closes #1005
Closes phpstan/phpstan#6560

This will give the same behavior for cast vs intval/floatval functions in
https://phpstan.org/r/850196c1-5f6c-479d-a25a-dd303e9cd047

Not sure if it's worth a non-regression test... should I write a test to expect all the [argument.type](https://phpstan.org/error-identifiers/argument.type) errors ?

@VincentLanglet VincentLanglet requested a review from staabm July 24, 2025 15:31
Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

Looking at https://phpstan.org/r/62904f7f-1538-422c-a6c4-f3fb53fc40a4 I don't think this is enough. We should have regression test in both CallToFunctionParametersRuleTest and InvalidCastRuleTest making sure they behave the same.

@VincentLanglet
Copy link
Contributor Author

Looking at phpstan.org/r/62904f7f-1538-422c-a6c4-f3fb53fc40a4 I don't think this is enough. We should have regression test in both CallToFunctionParametersRuleTest and InvalidCastRuleTest making sure they behave the same.

The pr wasn't good at all, I reworked it with #4314.

And the whole issue is not closed yet indeed.

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.

Handle different ways to cast the same

3 participants