SonarCommunity/sonar-php — pull request #5 by mmcaya (2014-09-10 00:37:02+00:00)
Title: Tested and fixed NullPointerException when checking alternate syntax swi...

...tch statements

Attempts to parse an older internal code base exposed a fatal error when encountering alternate syntax switch statements.

http://php.net/manual/en/control-structures.alternative-syntax.php

Truncated error:

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
...
Caused by: java.lang.NullPointerException at org.sonar.php.checks.NonEmptyCaseWithoutBreakCheck.hasNoBreakComment(NonEmptyCaseWithoutBreakCheck.java:53)

Updated tests and isLastCase method to support the 'endswitch' token.