When testing twice the same variable in nested ifs, even if the variable has been overwritten, the inspection reports:
The condition is duplicated in another if/elseif branch.
How to reproduce:
function getUserIdFromSession() { return null; }
function getUserIdFromPermanentSession() { return null; }
function test()
{
$userId = getUserIdFromSession();
if ($userId === null) {
$userId = getUserIdFromPermanentSession();
if ($userId === null) { // "The condition is duplicated in another if/elseif branch."
return null;
}
// ...
}
// ...
}
It would be nice to detect when the variable has been overwritten!
Fixed.
Note: further extension of #306
Thanks, that was fast!
You are welcome =)
Fixed #550, coming into 2.3.12