fixed switch { .. default: case 'test': ... bug
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / problem / ProblemReporter.java
index 9df2dae..78baf7d 100644 (file)
@@ -24,7 +24,6 @@ import net.sourceforge.phpdt.internal.compiler.lookup.LocalVariableBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.MethodBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.ProblemMethodBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.ProblemReasons;
-import net.sourceforge.phpdt.internal.compiler.lookup.ProblemReferenceBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.ReferenceBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.SourceTypeBinding;
 import net.sourceforge.phpdt.internal.compiler.lookup.SyntheticArgumentBinding;
@@ -54,7 +53,6 @@ import net.sourceforge.phpeclipse.internal.compiler.ast.ExplicitConstructorCall;
 import net.sourceforge.phpeclipse.internal.compiler.ast.Expression;
 import net.sourceforge.phpeclipse.internal.compiler.ast.FieldDeclaration;
 import net.sourceforge.phpeclipse.internal.compiler.ast.FieldReference;
-import net.sourceforge.phpeclipse.internal.compiler.ast.ImportReference;
 import net.sourceforge.phpeclipse.internal.compiler.ast.InstanceOfExpression;
 import net.sourceforge.phpeclipse.internal.compiler.ast.IntLiteral;
 import net.sourceforge.phpeclipse.internal.compiler.ast.Literal;
@@ -378,7 +376,11 @@ public class ProblemReporter extends ProblemHandler implements ProblemReasons {
        switch(problemId){
            case IProblem.PHPVarDeprecatedWarning :
                  return this.options.getSeverity(CompilerOptions.PHPVarDeprecatedWarning);
-       
+           case IProblem.PHPBadStyleKeywordWarning :
+                 return this.options.getSeverity(CompilerOptions.PHPBadStyleKeywordWarning);
+           case IProblem.PHPBadStyleUppercaseIdentifierWarning :
+             return this.options.getSeverity(CompilerOptions.PHPBadStyleUppercaseIdentifierWarning);
+
                case IProblem.MaskedCatch : 
                        return this.options.getSeverity(CompilerOptions.MaskedCatchBlock);
 
@@ -2708,4 +2710,22 @@ public class ProblemReporter extends ProblemHandler implements ProblemReasons {
     this.handle(IProblem.PHPVarDeprecatedWarning, NoArgument, new String[]{},
         problemStartPosition, problemEndPosition, context, compilationResult);
   }
+  
+  public void phpKeywordWarning(String[] messageArguments,
+      int problemStartPosition, int problemEndPosition,
+      ReferenceContext context, CompilationResult compilationResult) {
+    if (computeSeverity(IProblem.PHPBadStyleKeywordWarning) == Ignore)
+      return;
+    this.handle(IProblem.PHPBadStyleKeywordWarning, NoArgument, messageArguments,
+        problemStartPosition, problemEndPosition, context, compilationResult);
+  }
+  
+  public void phpUppercaseIdentifierWarning( 
+      int problemStartPosition, int problemEndPosition,
+      ReferenceContext context, CompilationResult compilationResult) {
+    if (computeSeverity(IProblem.PHPBadStyleUppercaseIdentifierWarning) == Ignore)
+      return;
+    this.handle(IProblem.PHPBadStyleUppercaseIdentifierWarning, NoArgument, new String[]{},
+        problemStartPosition, problemEndPosition, context, compilationResult);
+  }
 }