void (@NotNull PsiParameter variable) { final PsiElement scope = variable.getDeclarationScope(); if (scope instanceof PsiCatchSection || scope instanceof PsiForeachStatement || scope instanceof PsiLambdaExpression) { return; } final String name = variable.getName(); if (isValid(name)) { return; } registerVariableError(variable, name); }