Inspectopedia 2024.3 Help

Control flow

'foreach' variable overwrites already defined variable   New in this release

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   New in this release

Reports the if statements with duplicated common parts.

'never'-typed function returns a value   New in this release

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

'switch' with common parts   New in this release

Reports the 'switch' statements with duplicated common parts.

Array write access is not used   New in this release

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

Condition always evaluates to 'true/false'   New in this release

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   New in this release

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

Expression is always 'null'   New in this release

Reports the variables in return statements that are always null.

Loop does not iterate   New in this release

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

Result of 'instanceof' is always 'true'   New in this release

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

Typed property might be uninitialized   New in this release

Reports the attempts to read from an uninitialized typed property.

Unnecessary 'else' branch   New in this release

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

Unreachable statement   New in this release

Reports the statements that cannot be reached.

Write access to referenced array value without 'unset'   New in this release

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

Last modified: 11 September 2024