Skip to content

Commit 240b8d3

Browse files
fredemmottsebastianbergmann
authored andcommitted
Ignore Hack enum declarations
Without this, phpunit incorrectly considers this to be untested executable code: https://github.com/hhvm/hack-codegen/blob/master/src/CodegenWithVisibility.php#L13 Tested with: ``` hhvm -d hhvm.jit=0 -d hhvm.enable_call_builtin=0 -d xdebug.enable=1 vendor/bin/phpunit --coverage-html ./coverage ``` against https://github.com/hhvm/hack-codegen
1 parent e7d7a4a commit 240b8d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/CodeCoverage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,10 @@ private function getLinesToBeIgnored($filename)
866866
}
867867
break;
868868

869+
case 'PHP_Token_ENUM':
870+
$this->ignoredLines[$filename][] = $token->getLine();
871+
break;
872+
869873
case 'PHP_Token_NAMESPACE':
870874
$this->ignoredLines[$filename][] = $token->getEndLine();
871875

0 commit comments

Comments
 (0)