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

[DeadCode] Skip sub type false => bool on RemoveUselessVarTagRector #5588

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @kamil-tekiela

Comment on lines 90 to 92
// normalize bool union types
$phpParserNodeType = $this->normalizeConstantBooleanType($phpParserNodeType);
$phpStanDocType = $this->normalizeConstantBooleanType($phpStanDocType);
Copy link
Member Author

Choose a reason for hiding this comment

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

this apparently, make the valid removal skipped for super type:

     /** @var string|bool|null */
     private static string|false|null $inputArgSeparator = null;

which docblok is super type, I will look more.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added failing test case for valid removal super type 0c89834

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed with equal and sub type check 3690cad

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit a43f041 into main Feb 9, 2024
41 checks passed
@samsonasik samsonasik deleted the skip-sub-type branch February 9, 2024 08:09
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.

Incorrect behavior of RemoveUselessVarTagRector
2 participants