PHP_Codesniffer-VariableAnalysis icon indicating copy to clipboard operation
PHP_Codesniffer-VariableAnalysis copied to clipboard

detect isset() and mark found variables declared

Open Boldewyn opened this issue 10 years ago • 0 comments

If you have code like

if (isset($foo)) {
    $bar = $foo;
}

you already guard yourself against undefined variables. In this case the sniff should treat the variable as if it were declared.

Boldewyn avatar Oct 08 '15 10:10 Boldewyn