[DeadCode] Skip trait on RemoveAlwaysTrueIfConditionRector#7759
[DeadCode] Skip trait on RemoveAlwaysTrueIfConditionRector#7759TomasVotruba merged 1 commit intomainfrom
Conversation
|
Fixed 🎉 /cc @calebdw |
|
@TomasVotruba ready 👍 |
|
Thanks for looking into this, but skipping traits indiscriminately doesn't seem like the correct approach... Maybe this is a bug in phpstan? What does it think the type is? |
|
PHPStan seems requires context that the trait used under some class so it can show the type used https://phpstan.org/r/602e0b7d-009e-43f1-9a86-2be3d0e272f6 without the class that use it, it will show: |
The trait is used in my project and phpstan does analyze it. Preventing this rule from running in all traits is going to make this rule much less useful |
|
This may requires set but that will cause other tests errors, feel free to create alternative PR :) |
|
@samsonasik Looks good, thank you 👍 |
Fixes rectorphp/rector#9530
it seems unreliable detect true bool type on trait.