Inspectopedia Help

Control flow

'foreach' variable overwrites already defined variable  

Reports the keys and values in foreach loops that are assigned a non-primitive value before the foreach loop and are accessed after it.

'if' with common parts  

Reports the if statements with duplicated common parts.

'never'-typed function returns a value  

Reports the functions with the never return type hint that may return some value.

'switch' with common parts  

Reports the 'switch' statements with duplicated common parts.

Array write access is not used  

Reports the array write access expressions that are not used in code afterwards.

Condition always evaluates to 'true/false'  

Reports the conditions that are already covered by earlier conditions and thus have no effect as well as the variables that are always true (or always false) when reached.

Condition inside logical expression checked by subsequent condition  

Reports the conditions inside logical binary expressions that are covered by subsequent conditions and are therefore redundant.

Expression is always 'null'  

Reports the variables in return statements that are always null.

Loop does not iterate  

Reports the loop statements whose bodies will execute at most once.

Result of 'instanceof' is always 'true'  

Reports the instanceof expressions whose argument is within the hierarchy of the checked variable.

Typed property might be uninitialized  

Reports the attempts to read from an uninitialized typed property.

Unnecessary 'else' branch  

Reports the else branches in if statements whose bodies always execute a terminating statement such as return or throw.

Unreachable statement  

Reports the statements that cannot be reached.

Write access to referenced array value without 'unset'  

Reports the write access expressions on variables that are still referencing the array value previously used in a foreach statement.

Last modified: 29 April 2024