Skip to content

RedundantCondition

A condition is always true or always false based on the known types.

<?php
function process(int $n): void {
if (is_int($n)) { // always true — $n is already typed as int
// ...
}
}

Remove the redundant check or widen the type to make the check meaningful.