function test4 in Coder 8.2
Same name in this branch
Same name and namespace in other branches
- 8.3 tests/DrupalPractice/CodeAnalysis/VariableAnalysisUnitTest.inc \test4()
- 8.3 tests/DrupalPractice/good/good.php \test4()
- 8.3 tests/Drupal/Commenting/FunctionCommentUnitTest.inc \test4()
- 8.3 tests/Drupal/bad/bad.php \test4()
- 8.3 tests/DrupalPractice/Objects/drupal8/example.module \test4()
- 7.2 coder_sniffer/Test/bad/bad.php \test4()
- 8.3.x tests/DrupalPractice/CodeAnalysis/VariableAnalysisUnitTest.inc \test4()
- 8.3.x tests/DrupalPractice/good/good.php \test4()
- 8.3.x tests/Drupal/Commenting/FunctionCommentUnitTest.inc \test4()
- 8.3.x tests/Drupal/bad/bad.php \test4()
- 8.3.x tests/DrupalPractice/Objects/drupal8/example.module \test4()
Global variables that are used in ifs should not be flagged as unused.
File
- coder_sniffer/
DrupalPractice/ Test/ good/ good.php, line 67
Code
function test4() {
global $user;
$x = 5;
if ($x == 5) {
$user = 123;
}
}