boolean (PsiExpression expr) { if (!super.isApplicable(expr)) return false; if (!expr.isPhysical()) return false; PsiElement expressionStatement = expr.getParent(); if (!(expressionStatement instanceof PsiExpressionStatement)) return false; PsiElement statementParent = expressionStatement.getParent(); if (!isElseBranch(expr, statementParent) && !(statementParent instanceof PsiCodeBlock) && !(FileTypeUtils.isInServerPageFile(statementParent) && statementParent instanceof PsiFile)) { return false; } return true; }