Skip to content

Remove unnecessary filter_var with FILTER_VALIDATE_BOOLEAN option #8879

@Harfusha

Description

@Harfusha

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;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions