Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jul 26, 2025

No description provided.

@staabm staabm marked this pull request as ready for review July 26, 2025 09:46
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

new NullType(),
];
if ($dimType instanceof ConstantIntegerType) {
if ($dimType->isInteger()->yes()) {
Copy link
Contributor Author

@staabm staabm Jul 26, 2025

Choose a reason for hiding this comment

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

$dimType instance ConstantIntegerType is already narrowed in the outer if

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.

Hey, this change isn't really valuable. With the original code it's obvious what's going on. We just want the if to be executed only when the left part of BooleanOr is true.

It'd also be nice to change the line with $dimType instanceof ConstantIntegerType || $dimType instanceof ConstantStringType. I understand that it might be difficult, in that case feel free to close the PR.

@staabm staabm closed this Jul 26, 2025
@staabm staabm deleted the clean-sc branch July 26, 2025 21:02
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