rector
rector copied to clipboard
Remove unnecessary filter_var with FILTER_VALIDATE_BOOLEAN option
Feature Request
When variable is always boolean it is unnecessary to run it trough filter_var with FILTER_VALIDATE_BOOLEAN option.
Diff
function test(bool $isTest): bool {
- if (filter_var($isTest, FILTER_VALIDATE_BOOLEAN)) {
+ if ($isTest) {
return true;
}
return false;
}
filter_var is 7x slower than simple boolean check
Looking into this...